Arun
Arun

Reputation: 1177

Best Spring API for developing GenericDao

I see lot of implementation technique about spring jpa(jpatemplate,japdaosupport spring-data-jpa ,native way entitymanager,HibernateSupport,ect ),which one is best technique for developing Generic DAO ,that should be clean resource allocation ,transaction management , and high performance . what are pros and cons

scenario

Upvotes: 1

Views: 465

Answers (2)

ŁukaszBachman
ŁukaszBachman

Reputation: 33735

I think the best way would be to stick to the @PersistentContext to handle instances of EntityManagers, and inject them into some third party generic dao. You could write one on your own, use spring-data as mentioned by @Ralph or try libraries like Hades.

Upvotes: 1

Ralph
Ralph

Reputation: 120831

Spring-data-jpa comes with an already compleate GenericDao (with all the stuff you mentiond), but as far as I know you will need at least a (empty) interface for each concrete dao.

Upvotes: 1

Related Questions