How does Java Persistence work

how to use java persistence in netbeans and how to use java persistence api and how to use java persistence and java persistence entitymanager example
LexiWills Profile Pic
LexiWills,United Kingdom,Professional
Published Date:31-07-2017
Your Website URL(Optional)
Comment
EclipseLink: The Evolution of Java Persistence Shaun Smith shaun.smithoracle.com / shaunMsmith 3 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. About Me • From Toronto, Canada • Product Manager at Oracle for TopLink • Object-Relational Mapping since ’96 • Committer on various Eclipse projects including EclipseLink & Gemini • Presented at many conferences including JavaOne, Devoxx, QCon, EclipseCon, & JAX 4 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Agenda • Introduction • Evolutionary Pressures • New EclipseLink Features • Conclusion 5 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. JAVA PERSISTENCE 6 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Java Persistence: The Problem Space customer id=“…” Customer name…/name id: int JAXB … name: String /contact-info creditRating: int /customer Java XML JPA DBWS CUST JPA: Java Persistence API ID NAME C_RATING JAXB : Java Architecture for XML Binding Relational 7 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. EclipseLink Project • Object-Relational: Java Persistence API (JPA) – JPA 1.0 part of EJB 3.0 standard (JSR 220) – JPA 2.0 standardized in JSR 317 – EclipseLink is JPA 2.0 & 2.1 Reference Implementation • Object-XML: Java Architecture for XML Binding (JAXB) – JAXB 2.2 Certified Implementation • Object-XML: Service Data Objects – SDO 2.1.1 standardized in JSR 235 – EclipseLink is SDO 2.1.1 Reference Implementation 8 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. EclipseLink Project Java SE Java EE OSGi JPA MOXy DBWS XML Data Legacy Systems Databases 9 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. EclipseLink: Distributions Eclipse.org  www.eclipse.org/eclipselink/downloads  http://download.eclipse.org/rt/eclipselink/updates Oracle  TopLink 11g & 12c  WebLogic Server 11g & 12c GlassFish v3  Replaces TopLink Essentials  JPA 2.0 Reference Implementation Spring Source  Spring Framework and Bundle Repository JOnAS JEUS TMaxSoft 10 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. EclipseLink History & Future • EclipseLink 1.0 - July 2008 – JPA 1.0, simple upgrade from TopLink Essentials (JPA 1.0 RI) • EclipseLink 1.1 - March 2009 – JPA 1.0 with some JPA 2.0 capabilities (1.1.2 in Eclipse Galileo) • EclipseLink 2.0 - December 2009 – JPA 2.0 reference Implementation • EclipseLink 2.1 (Helios) – June 2010 • EclipseLink 2.3 (Indigo) – June 2011 • EclispeLink 2.4 (Juno) – June 2012 11 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Software Evolution • Computing architecture is constantly evolving: Mainframe, client/server, web/thin client, mobile/apps, ... • Current technologies with increasing adoption include: – Cloud computing – HTML 5 – NoSQL databases • Java EE 7 is evolving to address many of these new requirements • EclipseLink JPA and JAXB are also evolving 12 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. New Features • REST—client/server over HTTP with identified resources • Dynamic Persistence—persistence for web (JavaScript) applications • Multitenancy—support for multiple customers in single application/server/database • Customization—customize application instances per customer 13 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. JPA-RS 14 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. EclipseLink JPA-RS • Provides a service that exposes JPA mapped entities over REST via JAX-RS • HTTP message body either XML or JSON • Client – HTML 5 with JavaScript (primary focus) – JavaFX 15 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. What is REST? • REST – REpresentational State Transfer • Priniciples: – Addressable resources (URI per resource) – Small set of well-defined methods (i.e. GET, PUT, POST, DELETE) – Representation-oriented – Communicate statelessly 16 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. What is JAX-RS? • Java API for RESTful Services – Java EE specification (Jersey is reference implementation) • Principles – Java EE framework for implementing RESTful services – Provides annotations to bind combination of URI and HTTP operation to Java methods. • Specifications – JAX-RS 1.0 (JSR 311) – Released October 2008 – JAX-RS 2.0 (JSR 339) – In Progress 17 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. JAX-RS with JPA Example – GET Invoice public class InvoiceService ... public Invoice read(int id) return null; ... 18 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. JAX-RS with JPA Example – GET Invoice Stateless public class InvoiceService ... public Invoice read(int id) return entityManager.find(Invoice.class, id); ... 19 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. JAX-RS with JPA Example – GET Invoice Path("/invoice") Stateless public class InvoiceService ... public Invoice read(int id) return entityManager.find(Invoice.class, id); ... 20 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. JAX-RS with JPA Example – GET Invoice Path("/invoice") Stateless public class InvoiceService ... GET Path("id") public Invoice read(PathParam("id") int id) return entityManager.find(Invoice.class, id); ... 21 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. JAX-RS with JPA Example – GET Invoice Path("/invoice") Stateless public class InvoiceService ... GET Path("id") Produces("application/xml", "application/json") public Invoice read(PathParam("id") int id) return entityManager.find(Invoice.class, id); ... 22 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.

Advise: Why You Wasting Money in Costly SEO Tools, Use World's Best Free SEO Tool Ubersuggest.