I'm starting a new Web project and I've chosen JPA as my persistence ORM engine.
Although I've used OpenJPA in my last project, now I want to use EclipseLink.
Why? It is the JPA reference implementation, it has a lot of documentation and a very good support in the Eclipse IDE. Also, I can't found any benchmark that declares none of them to be the best, so performance is not a factor (all implementations has its own strength points).
But, I want to use the JSR-303 validation spec, and I've chosen hibernate-validator (witch is the reference implementation of the Bean Validation spec).
Moreover, I'm using Spring, and there are a lot of examples with Spring+Hibernate, but I haven't found any opinion that said Spring is better with Hibernate.
Is there any problem mixing this two implementations? Would be better to use Hibernate JPA with Hibernate Bean validation?
Hibernate is very popular implementation of JPA built by Red hat. It also has some extra features that JPA does not provide. Eclipse link jar file format − It is complete package. It has everything which need to run any Eclipse link functionality.
EclipseLink, built by the Eclipse Foundation, provides an open-sourced JPA implementation.
EclipseLink is the open source Eclipse Persistence Services Project from the Eclipse Foundation. The software provides an extensible framework that allows Java developers to interact with various data services, including databases, web services, Object XML mapping (OXM), and enterprise information systems (EIS).
I have been using EclipseLink
implementation of JPA with Spring and Hibernate-validation-4.2.0.Final
. And no problem so far. Now to answer your question:
Is there any problem mixing this two implementations?
I don't think there will be any problem using EclipseLink
JPA implementation with Hibernate
implementation for JSR-303 validation spec together, as the purpose of these two specifications are different:
Spring provides full support for the JSR-303 Bean Validation API. You just need to have a JSR-303 provider, such as Hibernate Validator, present in the classpath and will be detected automatically.
And the Spring JPA, available under the org.springframework.orm.jpa
package, offers comprehensive support for the Java Persistence API
in a similar manner to the integration with Hibernate
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With