jpa - spring data like functionality for JEE6 -
i have experience building applications on spring framework primarily. wondering if there similar spring data api (to support data access layer) in jee6 space?
i know can wire in entity manager like:
@persistencecontext entitymanager em;
ideally avoid writing reams of boiler plate jpa code on data access beans, api similar springjpa can cut down on amount of boilerplate code such findall(), findbyx() etc. example, springjpa can define bean as:
@repository public interface foorepository extends jparepository<foo, string> { }
whereas in vanilla jee6 need
- a foorepository interface methods
foo findone(long)
,list<foo> findall()
- a foorepositoryimpl implements interface , interacts entitymanager
spring data jpa ships cdi extension @inject
repository cdi managed bean. see reference documentation details. approach still requires spring jars on classpath no container being bootstrapped. functionality available mongodb repositories.
Comments
Post a Comment