It is because you mixed annotating both fields and getters. According to the JPA spec, you must remain consistent, in which you JPA annotate either only the fields, or only the getters. (usually JPA looks at the ID field and than decides to consider the fields or getters).
Why @Transient of ejb3 is not working as expected? It still gets persisted
-
09-10-2022 - |
Domanda
import javax.persistence.*;
simple POJO
class A {
@Transient
protected transient someClass X;
}
Despite this, in the database, I still see it persisted? Any idea of this weird behavior?
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow