JPA Features

In this section we will discuss about the features of JPA (Java Persistence API).

JPA Features

JPA Features

     

In this section we will discuss about the features of JPA (Java Persistence API). This section will give you an idea about the capabilities of JPA based applications. These days' java developers are using Java Persistence API to develop complex applications.

The introduction of Java Persistence API (JPA) into JEE specification is another major steps towards simplifying the development processes. JPA simplifies the entity persistence model and adds new capabilities. These new capabilities were not present in the earlier versions of EJB (EJB 2.1). Now developers can directly map the persistence object (POJO classes) with the relational database. The Java Persistence API has standardized the object-relational mapping technique.

The JPA can be used outside the container, which was earlier not possible in the EJB 2.1. You can use JPA in your swing applications also.

Here are the features of JPA:

The Java Persistence API is now here to simplify the developer's life. Developers can now use the JPA API to develop the applications easily. Here are the features of JPA:

  • JPA supports pluggable, third party persistence providers such as Hibernate and Toplink
  • JDK 5 annotations are fully supported
  • Few java classes are required to develop the persistence applications
  • JPA application can run outside the container also. So, developers can use JPA capabilities in desktop applications also
  • No need to write deployment descriptors. Annotations based meta-data are supported in JPA applications
  • Annotations defaults can be used in model class, which saves a lot of development time
  • Provides cleaner, easier, standardized object-relational mapping
  • JPA supports inheritance, polymorphism, and polymorphic queries.
  • JPA also supports named (static) and dynamic queries.
  • JEB QL is very powerfully query language provided by JPA
  • JPA helps you build a persistence layer that is vendor neutral and any persistence provider can be used
  • Many IDE's are also available to ease the development of JPA applications
  • Some IDE's can generate the model and persistence code from database schema
  • JPA application can also be configured to generate database schema based on persistence model
  • It is also very easy to switch to most performing persistence provider. You can easily move to any commercial persistence providers

In the next sections will discuss the steps to develop application using JPA specifications. We will be using MySQL and hibernate to develop the example applications.