Does the javax.persistence.transient annotation and the java.beans.transient annotation do the same thing? I know that the latter was only introduced in Java 7. I'm just curious as we recently upgraded to Java 7 on our servers and I'm wondering if Hibernate will work the same with either of the annotations.
解决方案
As @Wundwin Born said before:
javax.persistence.transient will make sure that Hibernate will ignore that particular field from saving it into the db and vice-versa.
java.beans.transient will make sure that the particular field will be ignored by the encoders (derived from Encoder). See http://docs.oracle.com/javase/7/docs/api/java/beans/Transient.html