Both persistence frameworks implement JPA.
1 - Is there a difference between the two?
Yes, there are differences.
However, common sense understands that the purpose is the same: both implement JPA Specification . Home
Hibernate was born without JPA but today it is common to access Hibernate by the JPA specification: Hibernate from JBoss, EclipseLink from the Eclipse Foundation and OpenJPA from Apache. Although Hibernate originated JPA, EclipseLink is the referential implementation. [ Hibernate - ORM Frameworks ]
2 - Which is the best in performance?
EclipseLink provides much more sophisticated and exotic layers and cache features,
as isolated caching to support virtual private database (virtual private database - vpd). And there's more. In EclipseLink's case, it has a fully integrated shared object cache, so not only is local persistence context management efficient, but all threads on the same server can also benefit from shared cache content. [
Pro JPA 2 ]
3 - How do the two implement the same specification, after developing a complete application is it possible to change from one framework to another without needing major changes to the source code?
In theory, yes, it should. The main query language is Java Persistence Query Language (JP QL), a database-independent query language that operates on the logical entity model as opposed to the physical data model. But in practice it will depend on the native SQL dialect used in the lines of code (not recommended). Before languages like JP QL became standardized, the most common method for building queries on many persistence providers was through a programming API. The query framework in EclipseLink, for example, was the most effective way to truly unlock the full power of your query engine. And even with the advent of JP QL, the programming APIs still remained in use to give access to resources not yet supported by the default query language. [
Pro JPA 2 ]
I think that's it, and sorry if I was somehow biased. It was not my intention.
References:
[
JPA Specification ]. Available at
JSR-000338 : Java (tm) Persistence Specification . Access: 31 Mar 2017.
[ Hibernate - Frameworks ORM ]. Available in #
A Practical Introduction to JPA with Hibernate . Access: 31 Mar 2017.
[ Pro JPA 2 ]. Available at Pro JPA 2 - A Definitive Guide to Mastering the Java Persistence API . Access: 31 Mar 2017.