Why does JPA have a @Transient annotation?

deamon picture deamon · Jan 28, 2010 · Viewed 325.1k times · Source

Java has the transientkeyword. Why does JPA have @Transient instead of simply using the already existing java keyword?

Answer

Jawher picture Jawher · Jan 28, 2010

Java's transient keyword is used to denote that a field is not to be serialized, whereas JPA's @Transient annotation is used to indicate that a field is not to be persisted in the database, i.e. their semantics are different.