This content has been marked as final.
Show 2 replies
-
1. Re: Overriding EntityHome methods with field updates in code
stephen May 29, 2008 9:59 PM (in response to medibadge)
I want to know:
(1) best way to override EntityHome persist() and update().
(2) best way to access Entity fields within the persist and update methods.No you don't ;-)
You want to know how set fields in the entity with the creation and modification dates, right?
IMHO the best way to do that is to make of of entity life cycle annotations @PrePersist and @PreUpdate.
For example add this to your entity:@PrePersist public void prePersist() { rowCreated = new Date(); }
-
2. Re: Overriding EntityHome methods with field updates in code
medibadge May 29, 2008 10:43 PM (in response to medibadge)In other words, pick up the
EJB3 In Action
book that has been sitting on your desk and read it!I am new to both Seam and EJB3, and have been reading about Seam but ignoring the EJB3 that I am also using. Shame on me!
This is really easy. Thanks!
Dick