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?
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
.