CIS 764Kansas State UniversityDirected by Riyad AlRihieliJava Persistence APIJPA
Review Topics: Introduction what is the JPA? What is the JPA contains of? Why developers should Create the JPA? Is th...
Introduction One of the significant improvement in the java plateform is the JPA. This is because it offers developers m...
What is JPA? JPA stands for a java persistence API which is Javax.Persistence Package. Basically , it is a Java programmi...
What is persistence consists of.. ? Any persistence consists of there Areas: The API, defined in the Javax. Persistencep...
What JPA does exactly? JPA defined a runtime Entity Manger APIprocessing queries and transaction on theobjects against th...
What is java persistence query language isused for? Basically, JPQL stands for Java PersistenceQuery Language. And it is ...
Is there relationship between the JPAand EJB? The answer is yes , there is a relationshipbetween Java Persistence API(JPA...
Sample Process of Using JavaPersistence API
Why we should use the Java PersistenceAPI? There is a great Motivation for creating JPA Many enterprise Java developers ...
Comparing the EJB3 and the EJB2 In fact, there are many differences, which are the advantages ofEJB3.0, between the EJB 2...
Example: to illustrate more In the EJB 3.0 entity, java developers do not require to codeinterfaces such as LocalAddressH...
Let’s look to Another Example In this example, java developers can map a hierarchy ofentities, where one entity subclasse...
Summary of the Advantages of JPA JPA Requires Just smaller number of classes andinterfaces It gets rid of lengthy deploy...
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/J...
QuestionsIf you want to know more about JPA ,just read this bookBy
Upcoming SlideShare
Loading in …5
×

Jpa basics

713 views

Published on

Published in: Technology, News & Politics
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
713
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
39
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Jpa basics

  1. 1. CIS 764Kansas State UniversityDirected by Riyad AlRihieliJava Persistence APIJPA
  2. 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. 3. Introduction One of the significant improvement in the java plateform is the JPA. This is because it offers developers much easier wayto access and manipulate relational data in the javaapplication. There is more than that . The reaction to the java persistence has beenextremely positive from the java community JPA has had a good start with strong acceptance bythe java developers.
  4. 4. What is JPA? JPA stands for a java persistence API which is Javax.Persistence Package. Basically , it is a Java programmingLanguage framework that helps developers to control relationaldata in java platform. The JPA exactly was described as part ofthe EJB3.0 , which is a replacement to the EJB2CMP EntityBeans specification, specification . As we know that a javapersistence API is the newest of several Java persistencespecifications.
  5. 5. What is persistence consists of.. ? Any persistence consists of there Areas: The API, defined in the Javax. Persistencepackage The java persistence Query Language Object / relational meta data.
  6. 6. What JPA does exactly? JPA defined a runtime Entity Manger APIprocessing queries and transaction on theobjects against the database. It is defined a objects-level query languageJPQL to allow querying of the objects fromthe database.
  7. 7. What is java persistence query language isused for? Basically, JPQL stands for Java PersistenceQuery Language. And it is used to makequeries for against entities stored in arelational database. Queries resemble SQLqueries in syntax, but operate against entityobjects rather than directly with databasetables.
  8. 8. Is there relationship between the JPAand EJB? The answer is yes , there is a relationshipbetween Java Persistence API(JPA) andEnterprise Java Beans (EJB). java persistence is a part of EJB which is it partof the Java EE5. Also, developers do not requireEJB container in order to run applications, whichuse persistence. The API might be usedoutside the container within Java EE andcan even stand alone in the JavaPlatform, Standard Edition (Java SE).
  9. 9. Sample Process of Using JavaPersistence API
  10. 10. Why we should use the Java PersistenceAPI? There is a great Motivation for creating JPA Many enterprise Java developers have been usinglightweight persistent objects, which supported byopen-source frameworks or data access objects as asubstitute of entity beans. This is because entitybeans and enterprise beans were too heavyweightand complicated. Furthermore, they could only beused in Java EE application servers.
  11. 11. Comparing the EJB3 and the EJB2 In fact, there are many differences, which are the advantages ofEJB3.0, between the EJB 2.1 version EJB 3.0 version :The EJB 3.0 EJB 2.11. Annotations and default replacea lot of cumbersome code.2. Persistence entities are simpleconcrete ,and plain old javaobject ( POJO)classes thatdevelopers can run as theywould any other simple javatechnology classes3. The API provides capabilities ,such as inheritance andpolymorphism.1. Developers have to createlengthy, complicated ,anddeployment descriptors inthe application that use EJBtechnology.2. Developers have toimplement the variousabstract classes , interfaces,and interface methodswhether they use them ornot.3. Those capabilities are not
  12. 12. Example: to illustrate more In the EJB 3.0 entity, java developers do not require to codeinterfaces such as LocalAddressHome and LocalAddress - or even adeployment descriptor. What they need to have just the entity class.This is because in the applications EJB 3.0 version, whats requiredfor an entity has been reduced from three classes -- for local interfacesand a business class -- to one entity class. In addition to that , theydon’t need to implement the EJBObject and EJBLocalObjectinterfaces. For instance, a session bean now need only a bean classand a business interface, which is a simple Java technology interface.
  13. 13. Let’s look to Another Example In this example, java developers can map a hierarchy ofentities, where one entity subclasses another, to a relationaldatabase structure, and submit queries against the base class.The queries are treated polymorphically against the entirehierarchy.
  14. 14. Summary of the Advantages of JPA JPA Requires Just smaller number of classes andinterfaces It gets rid of lengthy deployment descriptors throughannotations JPA Addresses most typical specifications throughannotation 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 theJPA Supports a Java Persistence query language -- animproved EJB QL Makes it easier to test entities outside of the EJB container Can be used outside of the container
  15. 15. what is my Tutorial ?double Click on the picture to see the tutorial
  16. 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.html) Java Persistence API 2.0—A Great Start Gets Better (TS-4945) by Edort.(http://java.sun.com/javaone/sf/2007/articles/persistence2_0.jsp) Article : The Java Persistence API - A Simpler Programming Model forEntity Persistence byBy Rahul Biswas and Ed Ort, May 2006(http://java.sun.com/developer/technicalArticles/J2EE/jpa/)
  17. 17. QuestionsIf you want to know more about JPA ,just read this bookBy

×