This content has been marked as final.
Show 2 replies
-
1. Re: Entity persisting itself
dkrizic May 13, 2005 2:11 AM (in response to messi)I don't think that this is a good idea.
Why don't you simply write a Home-Interface like PersonHome for an entity called Person which has all the logic:@Stateless public class PersonHome { private @Inject EntityManager em; public Person persist( Person p ) { // logic before persist em.persist( p ); // logic after persist return p; } }
-
2. Re: Entity persisting itself
epbernard May 13, 2005 4:11 AM (in response to messi)EJB3 entities cannot receive injection so @Inject is forbidden in them.
Do not assume cascading is slow until actually see it is