Ejava 11
Ejava 11
Architecture of jba
The Java Persistence API (JPA) is a specification of Java. It is used
to persist data between Java object and relational database. JPA
acts as a bridge between object-oriented domain models and
relational database systems. The jpa architecture consists of
units: 1. EntityManagerFactory-This is a factory class of
EntityManager. It creates and manages multiple EntityManager
instances. 2. EntityManager -It is an Interface, it manages the
persistence operations on objects. It works like factory for Query
instance. 3. Entity-Entities are the persistence objects, stores as
records in the database. 4. EntityTransaction-It has one-to-one
relationship with EntityManager. For each EntityManager,
operations are maintained by EntityTransaction class. 5.
Persistence-This class contain static methods to obtain
EntityManagerFactory instance. 6. Query-This interface is
implemented by each JPA vendor to obtain relational objects that
meet the criteria.