Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to JPA Java Persistence API Introduction to JPA.

Similar presentations

Presentation on theme: "Introduction to JPA Java Persistence API Introduction to JPA."— Presentation transcript:

1 Introduction to JPA Java Persistence API Introduction to JPA

2 ORM Object-Relational Mapping
Problem Object oriented programming languages Relational DBMS Several ORM frameworks has tried to ”fix” the problem Example: Hibernate JPA standardizes O/R mapping Introduction to JPA

3 Impedance mismatch EJB 3 In Action, page 252
OO model Relational model Class, object Table, row Attributes Columns Identity Primary key Methods Stored procedures Inheritance Not supported Polymorphism Introduction to JPA

4 Java EE 5 JPA is part of Java EE 5
JPA works between the Business Tier and the EIS tier (Enterprise Information System) Figure from ”Java EE 5 Tutorial” Introduction to JPA

5 Java EE 5 Some Java EE 5 containers GlassFish from Sun
Application Server from Oracle JBoss WebSphere from IBM WebLogic from BEA BEA was recently acquired by Oracle Apache Tomcat Not a full Java EE container, only a web container Introduction to JPA

6 Java Persistence API JPA is an API Some persistence providers
Implemented by a persistence provider Like JDBC is an API implemented by Some persistence providers Hibernate from JBoss TopLink from Oracle Kodo from BEA recently acquired by Oracle Introduction to JPA

7 The class EntityManager
EntityManager is the most important class of JPA Full name javax.persistence.EntityManager Some methods of EntityManager T find(primaryKey) Query createQuery(String jpql) Creates a JPQL query Query createNativeQuery(String sql) Creates a SQL query Some methods of Query List getResultList() Executes a Query and returns a list of objects Introduction to JPA

8 Java Persistence Query Language (JPQL)
Very much like ordinary SQL But not specific to any DBMS JPA converts JPQL to ordinary SQL for the actual DBMS Introduction to JPA

9 EJB 3 EJB 3 Enterprise Java Beans Important part of Java EE 5
Much simpler than EJB 2 POJO + annotations Plain Old Java Objects EJB classes can Create database tables or Be created from database tables Introduction to JPA

Download ppt "Introduction to JPA Java Persistence API Introduction to JPA."

Similar presentations

Ads by Google