1

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

  • entity >70
  • web app and webservices
  • future osgi support and multiple data sources
DataNucleus
  • 15,497
  • 3
  • 32
  • 37
Arun
  • 1,167
  • 18
  • 37

2 Answers2

1

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.

Ralph
  • 118,862
  • 56
  • 287
  • 383
1

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.

ŁukaszBachman
  • 33,595
  • 11
  • 64
  • 74