Vendor Lock-In :

  • Vendor Lock-In is one of the major reason to choose JPA in Java enterprise application development.
  • Today, There are several good  Object Relational Mapping(ORM) implementations available.
  • ORM tools perform the mapping between Objects and Relational database tables and there by solve Impedance Mismatch
    1. Hibernate – Open Source
    2. Top Link – By Oracle
    3. Eclipse Link – Eclipse Persistance Platform
    4. Open JPA – By Apache
    5. MyBatis – Open Source – Formerly known as iBATIS
    6. Many More …
  • These ORM tools allow the developers to focus on the Object model instead of dealing with the mismatch between the object oriented and relational models.
  • Unfortunately, each of these tools has its own set of APIs. This tightly couples the application code to the specific vendor(ORM Tool).

How JPA Resolves Vendor Lock-In?

  • JPA is a specification, It’s not an implementation. Hence, it cannot be used as it is for persistence.
  • An ORM implementation(such as Hibernate OR OpenJPA OR TopLink etc…) required to work with and persist Java Objects.
  • The key point of JPA having standard interface is that users can switch between implementations of JPA (Persistence Providers) without changing code.

Other reasons to choose JPA in Application Development :

  • JPA combines the best features from most of the available persistence standards.
    • Easy to use.
    • Supports large data sets.
    • Provides data consistency.
    • Allows concurrent use of information.
    • Provides querying capabilities of JDBC.
    • Allows using advanced object-oriented concepts such as inheritance.
JPA as part of EJB 3.0 specification. Even though, it's not required to have an EJB container or Java EE application server in order to run application that use Persistence.
JPA 2.0 has been officially separated from EJB 3.1 as distinct API.