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,199
  • 3
  • 30
  • 37
Arun
  • 1,087
  • 17
  • 36

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
  • 111,219
  • 48
  • 270
  • 362
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
  • 32,989
  • 10
  • 61
  • 69