Zero transient attributes
I have a method annotated with @PrePersist annotation, but I saw that when this method is executed, all my transient attributes (attributes annotated with @Transient) are zero.
When I debug the application, I see that these transient attributes are not null before I call the persist () method, and when it enters my PrePersist method, all the transient attributes are changed to zero.
This also happens with PostPersist methods and I need temp data in those methods.
Is this normal behavior? Can I avoid this by not storing this information in my database?
If it helps, I am using Hibernate 3.5 and JPA 2.
thanks
a source to share
It is similar to this question , which has a more detailed answer. Essentially, temporary information is lost under the hood. There is too little you can do about it.
a source to share