SlideShare une entreprise Scribd logo
1  sur  15
Series Overview Data Access with JPA Distributed Caching with Coherence Message Driven and Web Services with Spring RESTful Web Services with JAX-RS and Javascript UI with JQuery Troubleshooting and tuning ©2010 Oracle Corporation  1
Next Session: Distributed Caching with Coherence Learn how to: Integrate Coherence with JPA Manage Coherence Servers and Clusters from WebLogic Admin Console ©2010 Oracle Corporation  2
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 3
WebLogic Java Developer Webcast1. Data Access with JPA Shaun SmithProduct Manager—Oracle TopLinkSohailDadaniSr. Sales Consultant
Java Persistence API (JPA)—in a Nutshell Defines: How Java objects are stored in relational A programmer API for reading, writing, and querying persistent Java objects (“Entities”) A full featured query language in JP QL a container contract that supports plugging any JPA runtime in to any compliant container Java SE/EE Application Java Classes JPA Provider JDBC Driver PersistenceDescriptors Database Schema
JPA—Background A standardization of industry practices for Java POJO Object Relational Persistence Developed as part of the EJB 3.0 specification but now spun off into its own specification (JSR 317) Suitable for use in different modes Standalone in Java SE environment Hosted within a Java EE Container  Merging of expertise from persistence vendors and communities including: TopLink, Hibernate, JDO, EJB vendors and individuals
Oracle TopLink 11gR1 Oracle’s Enterprise Java Persistence Framework Includes open source EclipseLink with Commercial Support Certified  on and part of the Oracle WebLogic application server Includes TopLink Grid: JPA integration with Coherence Supports scaling JPA applications into very large clusters Development tool support in Eclipse OEPE, JDeveloper, and NetBeans
Customer id: int name: String creditRating: int CUST Object-Relational Mapping The activity of ‘Mapping’ is the process of connecting objects/attributes to tables/columns ID NAME C_RATING
Mapping with Annotations @Entitypublic class Customer {  @Id private Stringname; @OneToOne private Account account; public String getName() { return name; } public voidsetName(String name) { this.name = name; } public Account getAccount() { return account; } public void setAccount(Account account) { this.account = account; } }
Mappings with XML <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm" … <entityclass=“Customer">     <attributes> <idname=“name“/> <one-to-onename=“account“/>     </attributes> </entity> … </entity-mappings>
Typical Development Approaches Bottom Up Start from a database schema and generate JPA entities A good way to bootstrap a project if you’re building on an existing database Top Down Generate database schema from JPA entities A good way to get started in a green field development—focus on developing a good Java domain model Meet in the Middle Map Java classes to an existing database schema Maps optimized Java domain model to an optimized database schema—typically follows Bottom Up and Top Down
Our Development Scenario Building a simple JAX-RS fronted Java application that interacts with a relational database Starting from an XSD that describes the documents the system must support Technologies we’ll use: JPA, JAXB, and JAX-RS Development Approach: Use JAXB Schema compiler to generate JAXB annotated POJOS Follow JPA “Top Down” approach by defining JPA mappings for generated classes and then generating a database schema from those mapped classes.
JPA in Java EE
JPA in EJB
OracleWebLogic YouTube Channelwww.YouTube.com/OracleWebLogic ©2010 Oracle Corporation  15

Contenu connexe

Tendances

Introduction to RESTful Webservices in JAVA
Introduction to RESTful Webservices  in JAVA Introduction to RESTful Webservices  in JAVA
Introduction to RESTful Webservices in JAVA psrpatnaik
 
Developing RESTful WebServices using Jersey
Developing RESTful WebServices using JerseyDeveloping RESTful WebServices using Jersey
Developing RESTful WebServices using Jerseyb_kathir
 
Session 37 - JSP - Part 2 (final)
Session 37 - JSP - Part 2 (final)Session 37 - JSP - Part 2 (final)
Session 37 - JSP - Part 2 (final)PawanMM
 
Cwinters Intro To Rest And JerREST and Jersey Introductionsey
Cwinters Intro To Rest And JerREST and Jersey IntroductionseyCwinters Intro To Rest And JerREST and Jersey Introductionsey
Cwinters Intro To Rest And JerREST and Jersey Introductionseyelliando dias
 
RESTful Architecture
RESTful ArchitectureRESTful Architecture
RESTful ArchitectureKabir Baidya
 
Restful webservice
Restful webserviceRestful webservice
Restful webserviceDong Ngoc
 
Session 35 - Design Patterns
Session 35 - Design PatternsSession 35 - Design Patterns
Session 35 - Design PatternsPawanMM
 
JAX-RS. Developing RESTful APIs with Java
JAX-RS. Developing RESTful APIs with JavaJAX-RS. Developing RESTful APIs with Java
JAX-RS. Developing RESTful APIs with JavaJerry Kurian
 
Session 26 - Servlets Part 2
Session 26 - Servlets Part 2Session 26 - Servlets Part 2
Session 26 - Servlets Part 2PawanMM
 
REST & RESTful Web Service
REST & RESTful Web ServiceREST & RESTful Web Service
REST & RESTful Web ServiceHoan Vu Tran
 
Session 39 - Hibernate - Part 1
Session 39 - Hibernate - Part 1Session 39 - Hibernate - Part 1
Session 39 - Hibernate - Part 1PawanMM
 
Session 36 - JSP - Part 1
Session 36 - JSP - Part 1Session 36 - JSP - Part 1
Session 36 - JSP - Part 1PawanMM
 
Java Web Programming [3/9] : Servlet Advanced
Java Web Programming [3/9] : Servlet AdvancedJava Web Programming [3/9] : Servlet Advanced
Java Web Programming [3/9] : Servlet AdvancedIMC Institute
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API RecommendationsJeelani Shaik
 
RESTful services
RESTful servicesRESTful services
RESTful servicesgouthamrv
 
How to build a rest api.pptx
How to build a rest api.pptxHow to build a rest api.pptx
How to build a rest api.pptxHarry Potter
 
Session 33 - Session Management using other Techniques
Session 33 - Session Management using other TechniquesSession 33 - Session Management using other Techniques
Session 33 - Session Management using other TechniquesPawanMM
 
Session 40 - Hibernate - Part 2
Session 40 - Hibernate - Part 2Session 40 - Hibernate - Part 2
Session 40 - Hibernate - Part 2PawanMM
 

Tendances (20)

Introduction to RESTful Webservices in JAVA
Introduction to RESTful Webservices  in JAVA Introduction to RESTful Webservices  in JAVA
Introduction to RESTful Webservices in JAVA
 
Developing RESTful WebServices using Jersey
Developing RESTful WebServices using JerseyDeveloping RESTful WebServices using Jersey
Developing RESTful WebServices using Jersey
 
Session 37 - JSP - Part 2 (final)
Session 37 - JSP - Part 2 (final)Session 37 - JSP - Part 2 (final)
Session 37 - JSP - Part 2 (final)
 
Cwinters Intro To Rest And JerREST and Jersey Introductionsey
Cwinters Intro To Rest And JerREST and Jersey IntroductionseyCwinters Intro To Rest And JerREST and Jersey Introductionsey
Cwinters Intro To Rest And JerREST and Jersey Introductionsey
 
RESTful Architecture
RESTful ArchitectureRESTful Architecture
RESTful Architecture
 
Restful webservice
Restful webserviceRestful webservice
Restful webservice
 
Doing REST Right
Doing REST RightDoing REST Right
Doing REST Right
 
Session 35 - Design Patterns
Session 35 - Design PatternsSession 35 - Design Patterns
Session 35 - Design Patterns
 
JAX-RS. Developing RESTful APIs with Java
JAX-RS. Developing RESTful APIs with JavaJAX-RS. Developing RESTful APIs with Java
JAX-RS. Developing RESTful APIs with Java
 
Session 26 - Servlets Part 2
Session 26 - Servlets Part 2Session 26 - Servlets Part 2
Session 26 - Servlets Part 2
 
REST & RESTful Web Service
REST & RESTful Web ServiceREST & RESTful Web Service
REST & RESTful Web Service
 
Session 39 - Hibernate - Part 1
Session 39 - Hibernate - Part 1Session 39 - Hibernate - Part 1
Session 39 - Hibernate - Part 1
 
Rest web services
Rest web servicesRest web services
Rest web services
 
Session 36 - JSP - Part 1
Session 36 - JSP - Part 1Session 36 - JSP - Part 1
Session 36 - JSP - Part 1
 
Java Web Programming [3/9] : Servlet Advanced
Java Web Programming [3/9] : Servlet AdvancedJava Web Programming [3/9] : Servlet Advanced
Java Web Programming [3/9] : Servlet Advanced
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API Recommendations
 
RESTful services
RESTful servicesRESTful services
RESTful services
 
How to build a rest api.pptx
How to build a rest api.pptxHow to build a rest api.pptx
How to build a rest api.pptx
 
Session 33 - Session Management using other Techniques
Session 33 - Session Management using other TechniquesSession 33 - Session Management using other Techniques
Session 33 - Session Management using other Techniques
 
Session 40 - Hibernate - Part 2
Session 40 - Hibernate - Part 2Session 40 - Hibernate - Part 2
Session 40 - Hibernate - Part 2
 

Similaire à WebLogic Developer Webcast 1: JPA 2.0

Similaire à WebLogic Developer Webcast 1: JPA 2.0 (20)

Venkatarao_2+Years_Experiance_JAVA2
Venkatarao_2+Years_Experiance_JAVA2Venkatarao_2+Years_Experiance_JAVA2
Venkatarao_2+Years_Experiance_JAVA2
 
Shweta_Saini_Resume
Shweta_Saini_ResumeShweta_Saini_Resume
Shweta_Saini_Resume
 
Wei ding(resume)
Wei ding(resume)Wei ding(resume)
Wei ding(resume)
 
What's New for Data?
What's New for Data?What's New for Data?
What's New for Data?
 
Vaibhav_Jain
Vaibhav_JainVaibhav_Jain
Vaibhav_Jain
 
Sid K
Sid KSid K
Sid K
 
Developing Next-Gen Enterprise Web Application
Developing Next-Gen Enterprise Web ApplicationDeveloping Next-Gen Enterprise Web Application
Developing Next-Gen Enterprise Web Application
 
Resume
ResumeResume
Resume
 
J2 EEE SIDES
J2 EEE  SIDESJ2 EEE  SIDES
J2 EEE SIDES
 
MarvelSoft SchoolAdmin Dev Framework
MarvelSoft SchoolAdmin Dev FrameworkMarvelSoft SchoolAdmin Dev Framework
MarvelSoft SchoolAdmin Dev Framework
 
kowsalyamanickam_resume_OIM
kowsalyamanickam_resume_OIMkowsalyamanickam_resume_OIM
kowsalyamanickam_resume_OIM
 
Sreekanth java developer raj
Sreekanth java developer rajSreekanth java developer raj
Sreekanth java developer raj
 
Ziad Resume_New
Ziad Resume_NewZiad Resume_New
Ziad Resume_New
 
Javatraining
JavatrainingJavatraining
Javatraining
 
Rajesh Ramasamy
Rajesh RamasamyRajesh Ramasamy
Rajesh Ramasamy
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts framework
 
Rollin onj Rubyv3
Rollin onj Rubyv3Rollin onj Rubyv3
Rollin onj Rubyv3
 
Noonan_resume
Noonan_resumeNoonan_resume
Noonan_resume
 
Bhargav
BhargavBhargav
Bhargav
 
Abdulla Resume
Abdulla ResumeAbdulla Resume
Abdulla Resume
 

Dernier

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Dernier (20)

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

WebLogic Developer Webcast 1: JPA 2.0

  • 1. Series Overview Data Access with JPA Distributed Caching with Coherence Message Driven and Web Services with Spring RESTful Web Services with JAX-RS and Javascript UI with JQuery Troubleshooting and tuning ©2010 Oracle Corporation 1
  • 2. Next Session: Distributed Caching with Coherence Learn how to: Integrate Coherence with JPA Manage Coherence Servers and Clusters from WebLogic Admin Console ©2010 Oracle Corporation 2
  • 3. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 3
  • 4. WebLogic Java Developer Webcast1. Data Access with JPA Shaun SmithProduct Manager—Oracle TopLinkSohailDadaniSr. Sales Consultant
  • 5. Java Persistence API (JPA)—in a Nutshell Defines: How Java objects are stored in relational A programmer API for reading, writing, and querying persistent Java objects (“Entities”) A full featured query language in JP QL a container contract that supports plugging any JPA runtime in to any compliant container Java SE/EE Application Java Classes JPA Provider JDBC Driver PersistenceDescriptors Database Schema
  • 6. JPA—Background A standardization of industry practices for Java POJO Object Relational Persistence Developed as part of the EJB 3.0 specification but now spun off into its own specification (JSR 317) Suitable for use in different modes Standalone in Java SE environment Hosted within a Java EE Container Merging of expertise from persistence vendors and communities including: TopLink, Hibernate, JDO, EJB vendors and individuals
  • 7. Oracle TopLink 11gR1 Oracle’s Enterprise Java Persistence Framework Includes open source EclipseLink with Commercial Support Certified on and part of the Oracle WebLogic application server Includes TopLink Grid: JPA integration with Coherence Supports scaling JPA applications into very large clusters Development tool support in Eclipse OEPE, JDeveloper, and NetBeans
  • 8. Customer id: int name: String creditRating: int CUST Object-Relational Mapping The activity of ‘Mapping’ is the process of connecting objects/attributes to tables/columns ID NAME C_RATING
  • 9. Mapping with Annotations @Entitypublic class Customer { @Id private Stringname; @OneToOne private Account account; public String getName() { return name; } public voidsetName(String name) { this.name = name; } public Account getAccount() { return account; } public void setAccount(Account account) { this.account = account; } }
  • 10. Mappings with XML <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm" … <entityclass=“Customer"> <attributes> <idname=“name“/> <one-to-onename=“account“/> </attributes> </entity> … </entity-mappings>
  • 11. Typical Development Approaches Bottom Up Start from a database schema and generate JPA entities A good way to bootstrap a project if you’re building on an existing database Top Down Generate database schema from JPA entities A good way to get started in a green field development—focus on developing a good Java domain model Meet in the Middle Map Java classes to an existing database schema Maps optimized Java domain model to an optimized database schema—typically follows Bottom Up and Top Down
  • 12. Our Development Scenario Building a simple JAX-RS fronted Java application that interacts with a relational database Starting from an XSD that describes the documents the system must support Technologies we’ll use: JPA, JAXB, and JAX-RS Development Approach: Use JAXB Schema compiler to generate JAXB annotated POJOS Follow JPA “Top Down” approach by defining JPA mappings for generated classes and then generating a database schema from those mapped classes.

Notes de l'éditeur

  1. This is our standard disclaimer--we will touch on some visionary things in this talk that should not be used for contractual purposes.