Hi,
I have a SEAM app with some JPA/Hibernate entities. And I now wonder where to put my query, persistence methods.
The default choice seems to put them in a session bean layer with injected
@PersistenceContext(...) @Inject EntityManager entityManager;
But I think I would rather have the methods on the entities themselves. What are the pro's/con's?
- Testablity?
- Niceness?
- Performance?
And does anyone have links to best practices for interacting with the EntityManager etc. from methods on the Entities rather than session beans?
Best, Anders