Spring Data JPA like project not dependent on Spring

Does anyone know any Java frameworks that follows the repository approach with automatic implementation of query methods (eg findByNameAndLastName(…) ) but not tied to Spring, only pure JPA. Such feature also exists in GORM. I would like to see if there is any project that can be used in Guice or pure JavaEE environment without bringing Spring as a dependency.


(Disclaimer: I am the author of Spring Data JPA)

There is the CDI Query Module which is very similar to what Spring Data JPA. There's also a DeltaSpike module.

Note that Spring Data JPA ships with a CDI extension that creates repository proxies as plain CDI beans and does not bootstrap a Spring container. There are APIs that allow the creationg of repository proxies programmatically such as:

EntityManager em = // … obtain EntityManager
JpaRepositoryFactory factory = new JpaRepositoryFactory(em);
UserRepository repository = factory.getRepository(UserRepository.class);

Yes, it still requires Spring libraries to be present on the classpath but it is then using them similar to how you would use Commons Collection or the like. We try not to reinvent the wheel and the Spring libraries we depend on provide a lot of useful code that we do not have to re-code.

So if it's Spring as DI container you're worrying about, feel free to give the CDI extension of Spring Data JPA a choice. If you don't want to use any Spring whatsoever (for whatever reason), have a look at the alternatives.


Based on Oliver's information, followed up as also interested in this topic --

CDI Query joining Deltaspike mail thread: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Porting-the-CDI-Query-extension-project-to-DeltaSpike-td4329922.html

Deltaspike base link: http://deltaspike.apache.org/index.html

Getting started: http://deltaspike.apache.org/documentation.html

Just did their 0.4th release as of 5/31/2013.

However, have not done enough of a review to contrast/compare Deltaspike versus Spring-Data w/ CDI extensions (spring-data being very mature).


Take a look at Tomato on github!

It is a functional replacement for Spring JPA, has zero dependencies, performs better and is far easier to use. It will reduce your data access code by 98% and deliver the results you want right out of the box.

https://rpbarbati.github.io/Tomato.

If you want free, fully functional dynamic forms and/or tables for any Tomato entity or hierarchy, that can also be customized easily, try the angular based companion project...

https://rpbarbati.github.io/Basil

Both are current, maintained projects.

Try it yourself, or contact the author at rodney.barbati@gmail.com with questions.

链接地址: http://www.djcxy.com/p/44082.html

上一篇: JPA与JPA:有什么区别?

下一篇: Spring Data JPA就像不依赖于Spring的项目