SlideShare uma empresa Scribd logo
1 de 17
CIS 764
Kansas State University
Directed by Riyad AlRihieli
Java Persistence API
JPA
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.
Is there relationship between the JPA
and EJB?
 The answer is yes , there is a relationship
between Java Persistence API(JPA) and
Enterprise Java Beans (EJB).
 java persistence is a part of EJB which is it part
of the Java EE5. Also, developers do not require
EJB container in order to run applications, which
use persistence. The API might be used
outside the container within Java EE and
can even stand alone in the Java
Platform, Standard Edition (Java SE).
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.
Comparing the EJB3 and the EJB2
 In fact, there are many differences, which are the advantages of
EJB3.0, between the EJB 2.1 version EJB 3.0 version :
The EJB 3.0 EJB 2.1
1. Annotations and default replace
a lot of cumbersome code.
2. Persistence entities are simple
concrete ,and plain old java
object ( POJO)classes that
developers can run as they
would any other simple java
technology classes
3. The API provides capabilities ,
such as inheritance and
polymorphism.
1. Developers have to create
lengthy, complicated ,and
deployment descriptors in
the application that use EJB
technology.
2. Developers have to
implement the various
abstract classes , interfaces,
and interface methods
whether they use them or
not.
3. Those capabilities are not
Example: to illustrate more
 In the EJB 3.0 entity, java developers do not require to code
interfaces such as LocalAddressHome and LocalAddress - or even a
deployment descriptor. What they need to have just the entity class.
This is because in the application's EJB 3.0 version, what's required
for an entity has been reduced from three classes -- for local interfaces
and a business class -- to one entity class. In addition to that , they
don’t need to implement the EJBObject and EJBLocalObject
interfaces. For instance, a session bean now need only a bean class
and a business interface, which is a simple Java technology interface.
Let’s look to Another Example
 In this example, java developers can map a hierarchy of
entities, where one entity subclasses another, to a relational
database structure, and submit queries against the base class.
The queries are treated polymorphically against the entire
hierarchy.
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
what is my Tutorial ?
double Click on the picture to see the tutorial
References
 Wikipedia ebsite ( http://en.wikipedia.org/wiki/Java_Persistence_API)
 Answer website http://www.answers.com/Java%20Persistence%20API
 http://java.sun.com/javaee/5/docs/tutorial/doc/bnbqa.html
 Project Using Generics with Java Persistence by Sean Brydon,
Inderjeet Singh
(https://blueprints.dev.java.net/bpcatalog/ee5/persistence/generics.htm
l)
 Java Persistence API 2.0—A Great Start Gets Better (TS-4945) by Ed
ort.(http://java.sun.com/javaone/sf/2007/articles/persistence2_0.jsp)
 Article : The Java Persistence API - A Simpler Programming Model for
Entity Persistence byBy Rahul Biswas and Ed Ort, May 2006
(http://java.sun.com/developer/technicalArticles/J2EE/jpa/)
Questions
If you want to know more about JPA ,
just read this book
By

Mais conteúdo relacionado

Mais procurados

CR Bridge Solutions Pvt Ltd. Java slides
CR Bridge Solutions Pvt Ltd. Java slidesCR Bridge Solutions Pvt Ltd. Java slides
CR Bridge Solutions Pvt Ltd. Java slides
CRBTech
 

Mais procurados (20)

Basic of Java
Basic of JavaBasic of Java
Basic of Java
 
A seminar report on core java
A  seminar report on core javaA  seminar report on core java
A seminar report on core java
 
Top 10 Java Interview Questions and Answers 2014
Top 10 Java Interview Questions and Answers 2014 Top 10 Java Interview Questions and Answers 2014
Top 10 Java Interview Questions and Answers 2014
 
CR Bridge Solutions Pvt Ltd. Java slides
CR Bridge Solutions Pvt Ltd. Java slidesCR Bridge Solutions Pvt Ltd. Java slides
CR Bridge Solutions Pvt Ltd. Java slides
 
Notes of java first unit
Notes of java first unitNotes of java first unit
Notes of java first unit
 
Bca 4020 java programming
Bca 4020   java programmingBca 4020   java programming
Bca 4020 java programming
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
8 most expected java interview questions
8 most expected java interview questions8 most expected java interview questions
8 most expected java interview questions
 
Spring ppt
Spring pptSpring ppt
Spring ppt
 
Java interview questions
Java interview questionsJava interview questions
Java interview questions
 
Mi0041 java and web design
Mi0041   java and web designMi0041   java and web design
Mi0041 java and web design
 
Dev labs alliance top 20 basic java interview question for sdet
Dev labs alliance top 20 basic java interview question for sdetDev labs alliance top 20 basic java interview question for sdet
Dev labs alliance top 20 basic java interview question for sdet
 
Java
JavaJava
Java
 
Applying Anti-Reversing Techniques to Java Bytecode
Applying Anti-Reversing Techniques to Java BytecodeApplying Anti-Reversing Techniques to Java Bytecode
Applying Anti-Reversing Techniques to Java Bytecode
 
Introduction of java jdbc
Introduction of java jdbcIntroduction of java jdbc
Introduction of java jdbc
 
Introduction of java jdbc
Introduction of java jdbcIntroduction of java jdbc
Introduction of java jdbc
 
Core java interview questions
Core java interview questionsCore java interview questions
Core java interview questions
 
Introduction to Basic Java Versions and their features
Introduction to Basic Java Versions and their featuresIntroduction to Basic Java Versions and their features
Introduction to Basic Java Versions and their features
 
Reversing and Patching Java Bytecode
Reversing and Patching Java BytecodeReversing and Patching Java Bytecode
Reversing and Patching Java Bytecode
 
Enterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business LogicEnterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business Logic
 

Destaque

วิชา IS Independent Study ปกณ.
วิชา IS Independent Study ปกณ.วิชา IS Independent Study ปกณ.
วิชา IS Independent Study ปกณ.
Palmmie 'shez
 

Destaque (11)

Потребительский брендинг (разработка торговых марок FMCG)
Потребительский брендинг (разработка торговых марок FMCG)Потребительский брендинг (разработка торговых марок FMCG)
Потребительский брендинг (разработка торговых марок FMCG)
 
Growth Summit Singapore 2013 brochure
Growth Summit Singapore 2013 brochureGrowth Summit Singapore 2013 brochure
Growth Summit Singapore 2013 brochure
 
Serebrity presentation
Serebrity presentation Serebrity presentation
Serebrity presentation
 
2nd anniversary
2nd anniversary2nd anniversary
2nd anniversary
 
Eltherm parol
Eltherm parolEltherm parol
Eltherm parol
 
MedRecruit Leadership Programme - 7 - 'No surprises' leadership
MedRecruit Leadership Programme - 7 - 'No surprises' leadershipMedRecruit Leadership Programme - 7 - 'No surprises' leadership
MedRecruit Leadership Programme - 7 - 'No surprises' leadership
 
วิชา IS Independent Study ปกณ.
วิชา IS Independent Study ปกณ.วิชา IS Independent Study ปกณ.
วิชา IS Independent Study ปกณ.
 
Thuc hanh access
Thuc hanh accessThuc hanh access
Thuc hanh access
 
Parental Involvement in Low Income Areas
Parental Involvement in Low Income AreasParental Involvement in Low Income Areas
Parental Involvement in Low Income Areas
 
Разработка фирменного стиля. Презентация Fabula Branding
Разработка фирменного стиля. Презентация Fabula BrandingРазработка фирменного стиля. Презентация Fabula Branding
Разработка фирменного стиля. Презентация Fabula Branding
 
likas batas moral
likas batas morallikas batas moral
likas batas moral
 

Semelhante a Jpa basics

1. (with APA reference )Describe in detail the roles that the follow.pdf
1. (with APA reference )Describe in detail the roles that the follow.pdf1. (with APA reference )Describe in detail the roles that the follow.pdf
1. (with APA reference )Describe in detail the roles that the follow.pdf
arpitaeron555
 

Semelhante a Jpa basics (20)

Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
1. (with APA reference )Describe in detail the roles that the follow.pdf
1. (with APA reference )Describe in detail the roles that the follow.pdf1. (with APA reference )Describe in detail the roles that the follow.pdf
1. (with APA reference )Describe in detail the roles that the follow.pdf
 
מתפ
מתפמתפ
מתפ
 
Java J2EE Training in Chennai, Tambaram
Java J2EE  Training in Chennai, TambaramJava J2EE  Training in Chennai, Tambaram
Java J2EE Training in Chennai, Tambaram
 
java tutorial for beginner - Free Download
java tutorial for beginner - Free Downloadjava tutorial for beginner - Free Download
java tutorial for beginner - Free Download
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
Java. converted (2)
Java. converted (2)Java. converted (2)
Java. converted (2)
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
 
Java interview question
Java interview questionJava interview question
Java interview question
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Java Basics in Mule
Java Basics in MuleJava Basics in Mule
Java Basics in Mule
 
Java in Mule
Java in MuleJava in Mule
Java in Mule
 
Accelerating Development.pptx
Accelerating Development.pptxAccelerating Development.pptx
Accelerating Development.pptx
 
Jfxpub binding
Jfxpub bindingJfxpub binding
Jfxpub binding
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Java Fundamentals in Mule
Java Fundamentals in MuleJava Fundamentals in Mule
Java Fundamentals in Mule
 
Java E
Java EJava E
Java E
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Jpa basics

  • 1. CIS 764 Kansas State University Directed by Riyad AlRihieli Java Persistence API JPA
  • 2. 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?
  • 3. 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.
  • 4. 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.
  • 5. 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.
  • 6. 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.
  • 7. 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.
  • 8. Is there relationship between the JPA and EJB?  The answer is yes , there is a relationship between Java Persistence API(JPA) and Enterprise Java Beans (EJB).  java persistence is a part of EJB which is it part of the Java EE5. Also, developers do not require EJB container in order to run applications, which use persistence. The API might be used outside the container within Java EE and can even stand alone in the Java Platform, Standard Edition (Java SE).
  • 9. Sample Process of Using Java Persistence API
  • 10. 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.
  • 11. Comparing the EJB3 and the EJB2  In fact, there are many differences, which are the advantages of EJB3.0, between the EJB 2.1 version EJB 3.0 version : The EJB 3.0 EJB 2.1 1. Annotations and default replace a lot of cumbersome code. 2. Persistence entities are simple concrete ,and plain old java object ( POJO)classes that developers can run as they would any other simple java technology classes 3. The API provides capabilities , such as inheritance and polymorphism. 1. Developers have to create lengthy, complicated ,and deployment descriptors in the application that use EJB technology. 2. Developers have to implement the various abstract classes , interfaces, and interface methods whether they use them or not. 3. Those capabilities are not
  • 12. Example: to illustrate more  In the EJB 3.0 entity, java developers do not require to code interfaces such as LocalAddressHome and LocalAddress - or even a deployment descriptor. What they need to have just the entity class. This is because in the application's EJB 3.0 version, what's required for an entity has been reduced from three classes -- for local interfaces and a business class -- to one entity class. In addition to that , they don’t need to implement the EJBObject and EJBLocalObject interfaces. For instance, a session bean now need only a bean class and a business interface, which is a simple Java technology interface.
  • 13. Let’s look to Another Example  In this example, java developers can map a hierarchy of entities, where one entity subclasses another, to a relational database structure, and submit queries against the base class. The queries are treated polymorphically against the entire hierarchy.
  • 14. 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
  • 15. what is my Tutorial ? double Click on the picture to see the tutorial
  • 16. References  Wikipedia ebsite ( http://en.wikipedia.org/wiki/Java_Persistence_API)  Answer website http://www.answers.com/Java%20Persistence%20API  http://java.sun.com/javaee/5/docs/tutorial/doc/bnbqa.html  Project Using Generics with Java Persistence by Sean Brydon, Inderjeet Singh (https://blueprints.dev.java.net/bpcatalog/ee5/persistence/generics.htm l)  Java Persistence API 2.0—A Great Start Gets Better (TS-4945) by Ed ort.(http://java.sun.com/javaone/sf/2007/articles/persistence2_0.jsp)  Article : The Java Persistence API - A Simpler Programming Model for Entity Persistence byBy Rahul Biswas and Ed Ort, May 2006 (http://java.sun.com/developer/technicalArticles/J2EE/jpa/)
  • 17. Questions If you want to know more about JPA , just read this book By