|
|
dao impl: EntityManager vs. extending HibernateDaoSupport
What are people's thoughts on the implementation of the Dao layer?
1. Code to the javax.persistence.EntityManager interface and glue everything together with spring. 2. Extend HibernateDaoSupport and code directly to the Hibernate session API, or use the helpers in HibetnateDaoSupport?
Take a look:
main/20...or-jpatemplate
Thanks. That does address the issue about using the template/helper classes vs Hibernate directly.
I guess I see that the template/helpers are somewhat old school and perhaps not needed.
So now it boils down to.... should I use the hibernate session API directly, or the EntityManager interface provided by JPA?
Anyone else feel that the Java community paralyzes itself with too many options sometimes? If I have to take all this time deciding, is it really worth the flexibility?
What I would like to see is some kind of default recommendation for a brand new system using spring. I know there are trade-offs and nothing is ever the best but some sort of starting point would be nice. |
|