Java + Spring + hibernate : Dao implementation that is about to change in the future -
i'm developing web server spring 3 , hibernate 4.
in server have following interfaces:
- genericdao
- userdao extends genericdao
- productdao extends genericdao
- ... more daos here
and 3 implementations:
- hibernategenericdaoimpl
- hibernateuserdaoimpl
- hibernateproductdaoimpl
- ....more hibernate daos impl here
in future considering highly migrate no-sql db (maybe couchdb). questions is:
"since no-sql has nothing orm, need replace daos impl in project?! (there alot) isn't there more generic way?"
thanks!
what using jparepository : @ http://www.springsource.org/spring-data/jpa
crudrepository usefull , save lot of time. @ jpa-spring documentation define sub-interface of crudrepository store entity class objects. crudrepository define crud service , can add in interface method "findticketbyexpiredatebefore(date date)" spring use naming convention build implentation of requete if requete more complexe can use @query annotation write it
Comments
Post a Comment