This content has been marked as final.
Show 2 replies
-
1. Re: How to store old property state before update
stephen May 17, 2008 8:01 PM (in response to cardel.ka.jelinek.seznam.cz)Is User a JPA entity?
In that case you could do like this
import javax.persistence.Entity; import javax.persistence.PostLoad; import javax.persistence.Transient; import java.io.Serializable; @Entity public class User implements Serializable { @Transient private Boolean activatedInitial; private Boolean activated; public Boolean getActivated() { return activated; } public void setActivated(Boolean activated) { this.activated = activated; } @PostLoad public void afterLoad() { activatedInitial = activated; } }
Not the most elegant, but as long as you need to know the initial value for only this field...
-
2. Re: How to store old property state before update
cardel.ka.jelinek.seznam.cz May 17, 2008 9:34 PM (in response to cardel.ka.jelinek.seznam.cz)Yes, User is JPA Entity.
Thank You. This is what I need.