In this section, we are going to discuss about the Java Persistence API (JPA). It is a part of Java EE5 (Java Enterprise Edition 5) and EJB 3.0 (Enterprise Java Beans 3.0) specification. Java Persistence API provides simple POJO (Plain Old Java Object) class and standard OR mapping (Object Relational mapping).
[POJO : It stands for Plain Old Java Object that is used for referring the Java objects. This is a very simple class that contains all normal java objects. It doesn't extend or implement specialized classes.]
To use JPA you must be configured the JPA behavior of your entities using annotations. The JPA behavior is managed by the JPA persistence The JPA provides the facility to Java developers for managing an object relational data in Java applications called an object/relational mapping. The most important feature of JPA is that it is an independent API and easily integrate with J2EE as well as J2SE applications.
The JPA also provides the facility to load and save the data into database table without using any SQL query. As like if you use the the persist() method then it executes the insert SQL and merge() method updates your records by update query.
The javax.persistence: This is the package that contains all classes, interfaces and annotations that makes up the JPA.
Java Persistence can be used the following areas:
If you enjoyed this post then why not add us on Google+? Add us to your Circles
Liked it! Share this Tutorial
Discuss: Introduction to the Java Persistence API
Post your Comment