JPA
Java Persistence API
Review Topics:
Introduction
what is the JPA?
What is the JPA contains of?
Why developers should Create the JPA?
Is there Relationship between the EJB and JPA?
What the JPA dose exactly?
Sample process of java persistence API.
Comparing between the EJB3 and the EJB2?
What the advantages of using the JPA?
what is my Tutorial ?
Questions?
Introduction
One of the significant improvement in the java plate
form is the JPA.
This is because it offers developers much easier way
to access and manipulate relational data in the java
application.
There is more than that .
The reaction to the java persistence has been
extremely positive from the java community
JPA has had a good start with strong acceptance by
the java developers.
What is JPA?
JPA stands for a java persistence API which is Javax.
Persistence Package. Basically , it is a Java programming
Language framework that helps developers to control relational
data in java platform. The JPA exactly was described as part of
the EJB3.0 , which is a replacement to the EJB2CMP Entity
Beans specification, specification . As we know that a java
persistence API is the newest of several Java persistence
specifications.
What is persistence consists of.. ?
Any persistence consists of there Areas:
The API, defined in the Javax. Persistence
package
The java persistence Query Language
Object / relational meta data.
What JPA does exactly?
JPA defined a runtime Entity Manger API
processing queries and transaction on the
objects against the database.
It is defined a objects-level query language
JPQL to allow querying of the objects from
the database.
What is java persistence query language is
used for?
Basically, JPQL stands for Java Persistence
Query Language. And it is used to make
queries for against entities stored in a
relational database. Queries resemble SQL
queries in syntax, but operate against entity
objects rather than directly with database
tables.
Sample Process of Using Java
Persistence API
Why we should use the Java Persistence
API?
There is a great Motivation for creating JPA
Many enterprise Java developers have been using
lightweight persistent objects, which supported by
open-source frameworks or data access objects as a
substitute of entity beans. This is because entity
beans and enterprise beans were too heavyweight
and complicated. Furthermore, they could only be
used in Java EE application servers.
Summary of the Advantages of JPA
JPA Requires Just smaller number of classes and
interfaces
It gets rid of lengthy deployment descriptors through
annotations
JPA Addresses most typical specifications through
annotation defaults.
JPA supports easier, cleaner, and standardized object-
relational mapping.
It add support for polymorphism, and inheritance.
Also, dynamic queries and named queries is added to the
JPA
Supports a Java Persistence query language -- an
improved EJB QL
Makes it easier to test entities outside of the EJB container
Can be used outside of the container
Questions