+ All Categories
Home > Documents > Java Persistence: From NoSQL to...

Java Persistence: From NoSQL to...

Date post: 05-Jun-2020
Category:
Upload: others
View: 12 times
Download: 0 times
Share this document with a friend
33
1 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 1 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License Java Persistence: From NoSQL to HTML5 Shaun Smith (@shaunMsmith) Senior Principal Product Manager/Eclipse Committer
Transcript
Page 1: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

1 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 1 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Java Persistence: From NoSQL to HTML5

Shaun Smith (@shaunMsmith) Senior Principal Product Manager/Eclipse Committer

Page 2: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

2 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 2 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

About Me

§ Shaun Smith –  Eclipse committer on EclipseLink and related projects –  Oracle TopLink Product Manager –  OO developer since 1987

§  “Old guy who knows Smalltalk” ;-)

Page 3: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

3 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 3 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

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

www.eclipse.org/eclipselink

Page 4: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

4 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 4 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Agenda—Database to Browser (and back again) Browser

HTTP / REST

Binding Persistence XML/JSON

Java

Database Persistence Relational/NoSQL

Relational DB | NoSQL DB

Page 5: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

5 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 5 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Agenda Browser

HTTP / REST

Binding Persistence XML/JSON

Java

Database Persistence Relational/NoSQL

Relational DB | NoSQL DB

Page 6: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

6 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 6 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

NoSQL Databases

§ EclipseLink is best known for relational persistence but… § NoSQL databases are increasingly popular § No common definition (document, graph, columnar)

–  Differing feature sets –  Some offer query language/API—some not

§ No standards § Every database offers a unique API

–  Cost in terms of learning each database –  Zero portability across databases

Page 7: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

7 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 7 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

EclipseLink NoSQL

§ Support JPA-style access to NoSQL databases –  Leverage non-relational database support for JCA (and JDBC when

available)

§ Define annotations and XML to identify NoSQL stored entities (e.g., @NoSQL)

§ Support JPQL subset for each –  Key principal: leverage what’s available

§  Initial support for MongoDB and Oracle NoSQL

Page 8: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

8 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 8 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Applicability of JPA to NoSQL

§ Core JPA concepts apply to NoSQL: –  Persistent Entities, Embeddables, ElementCollection, OneToOne,

OneToMany, ManyToOne, Version, etc.

§ Some concepts apply with some databases: –  JPQL, NamedNativeQuery

§ Pure relational concepts don’t apply: –  CollectionTable, Column, SecondaryTable,

SequenceGenerator, TableGenerator, etc.

Page 9: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

9 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 9 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Querying NoSQL with JPA

§ Two kinds of queries –  JQPL—portable query language defined by the spec –  Native query—lets you leverage database specific features –  Dynamic or static @NamedQuery

§  JPQL translated to underlying database query framework.

Page 10: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

10 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 10 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Example MongoDB Mapped Entity

Page 11: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

11 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 11 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

MongoDB Query Examples

§ JPQL    Select o from Order o where o.totalCost > 1000

Select o from Order o join o.orderLines l where l.cost > :cost

§ Native Queries    query = em.createNativeQuery( "db.ORDER.findOne({\"_id\":\"" + oid + "\"})", Order.class);

Order order = (Order) query.getSingleResult();

Page 12: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

12 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 12 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Demo EclipseLink NoSQL

Page 13: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

13 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 13 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

“…we are gearing up for a shift to polyglot persistence - where any decent sized enterprise will have a variety of different data storage technologies for different kinds of data…we'll be first asking how we want to manipulate the data and only then figuring out what technology is the best bet for it..”

Martin Fowler ThoughtWorks

Page 14: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

14 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 14 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Composite Persistence Unit Composite PU

Relational PU NoSQL PU

Page 15: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

15 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 15 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Demo Polyglot Persistence

http:/git.eclipse.org/gitroot/eclipselink/examples.git/jpa/polyglot

Page 16: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

16 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 16 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Agenda Browser

HTTP / REST

Binding Persistence XML/JSON

Java

Database Persistence Relational/NoSQL

Relational DB | NoSQL DB

Page 17: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

17 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 17 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Binding Persistence

§ EclipseLink implements –  JAXB for Java/XML binding—covert Java to/from XML –  Java/JSON binding—convert Java to/from JSON

§ Currently no Java/JSON binding standard –  Java API for JSON Processing (JSR 535) is parsing, not binding

§ EclipseLink interprets JAXB XML bindings for JSON –  Content-type selectable by setting property on Marshaller/Unmarshaller

XML and JSON Binding

Page 18: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

18 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 18 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

XML and JSON from JAXB Mappings

{ "phone-numbers" : [ { "id" : 2, "num" : "512-555-9999", "type" : "mobile" } ], "address" : { "city" : "New York", "id" : 1, "street" : "Central Park East" }, "firstName" : "Woody", "id" : 1, "lastName" : “Allen" }

<?xml version="1.0" encoding="UTF-8"?> <customer> <phone-numbers> <phone-number> <id>2</id> <num>512-555-1234</num> <type>home</type> </phone-number> </phone-numbers> <address> <city>New York</city> <id>1</id> <street>Central Park East</street> </address> <firstName>Bill</firstName> <id>1</id> <lastName>Allen</lastName> </customer>

Page 19: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

19 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 19 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Challenges – Binding JPA Entities to XML/JSON

•  Bidirectional/Cyclical Relationships •  Composite Keys/Embedded Key Classes •  Byte Code Weaving

<customer> <phone-numbers> <phone-number> <id>1</id> ... <type>mobile</type> </phone-number> </phone-numbers> </customer>

JPA JAXB

Page 20: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

20 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 20 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Bidirectional Relationship @Entity public class Customer{ ... @OneToMany(mappedBy="owner") private List<Phone> phones;

}

@Entity public class Phone{ ... @ManyToOne private Customer owner;

}

Page 21: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

21 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 21 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Bidirectional Relationships in JAXB

§  JAXB specification does not support bidirectional relationships. One side must be marked @XmlTransient.

§ But that loses the relationship!

Customer Phone

<customer> <phone-numbers> <phone-number> <id>1</id> ... <type>mobile</type> </phone-number> </phone-numbers> </customer>

Marshall

Customer Phone

Unmarshall

X owner

phones phones

Page 22: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

22 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 22 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

EclipseLink XmlInverseReference @Entity public class Customer{ ... @OneToMany(mappedBy=“owner") private List<Phone> phones;

}

@Entity public class Phone{ ... @ManyToOne @XmlInverseReference(mappedBy=“phones") private Customer owner;

}

Page 23: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

23 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 23 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

EclipseLink XmlInverseReference

§ EclipseLink restores relationships on unmarshall!

<customer> <phone-numbers> <phone-number> <id>1</id> ... <type>mobile</type> </phone-number> </phone-numbers> </customer> Marshall

Customer Phone

owner

phones

Unmarshall

Customer Phone

owner

project

Page 24: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

24 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 24 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Demo JAXB/JPA Fidelity JSON Binding

http:/git.eclipse.org/gitroot/eclipselink/examples.git/jpa-moxy/jpa-moxy.simple

Page 25: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

25 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 25 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Agenda Browser

HTTP / REST

Binding Persistence XML/JSON

Java

Database Persistence Relational/NoSQL

Relational DB | NoSQL DB

Page 26: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

26 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 26 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

JPA-RS Browser

JAX-RS / JPA-RS

Binding Persistence XML/JSON

Java

Database Persistence Relational/NoSQL

Relational DB | NoSQL DB

HTTP

Page 27: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

27 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 27 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

JPA-RS

JPA-RS

JAX-RS

Accounting PU Human Resources PU Contracting PU

...

JPA

GET http://.../persistence/Accounting/Invoice/...

JPA-RS maps URI http://.../persistence/Accounting/Invoice/... to Accounting PU and Invoice entity

JAX-RS http://.../persistence/Accounting/Invoice/... mapped to JPA-RS service

Page 28: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

28 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 28 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

JPA-RS Features § Access relational data through REST with JSON or XML § Provides REST operations for entities in persistence unit (GET, PUT,

POST, DELETE) § Automatic generation of XML and JSON bindings § Supports invocation of named queries via HTTP § Server Caching—EclipseLink clustered cache § Dynamic Persistence also supported

–  Entities defined via metadata—no Java classes required –  Enables persistence services for HTML 5/JavaScript applications

Page 29: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

29 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 29 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Resource Model

JPA Entity Model

Resource Model

Page 30: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

30 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 30 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Resource Model & Links { "firstName": "Frank", "gender": "Male", "id": 1, "lastName": "Smith", "responsibilities": [], "salary": 1, "version": 13, "address": { "_link": { "href": "http://localhost:7001/employee.web-js/persistence/employee/entity/Address/18", "method": "GET", "rel": "self" } }, …

Page 31: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

31 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 31 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Demo EclipseLink JPA-RS

http:/git.eclipse.org/gitroot/eclipselink/examples.git/jpa/employee

Page 32: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

32 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 32 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

EclipseLink Roadmap

EclipseLink 2.3 Indigo

•  Tenant Isolation

•  SINGLE_TABLE •  Extensible •  External

Metadata •  Multiple DBs •  Data Partitioning

2010 2011 2012 2013 EclipseLink 2.1

Helios

•  Query Extensions •  TREAT AS •  FUNC

•  Batch IN and EXISTS

•  Attribute Group •  Load •  Fetch •  Copy •  Merge

•  eclispelink-oxm.xml

•  Dynamic MOXy

EclipseLink 2.4 Juno

•  JSON Binding •  JPA-RS •  Tenant Isolation

•  Tenant per Table/Schema

•  ALTER Schema •  NoSQL

EclipseLink 2.5 Kepler

•  JPA 2.1 •  JPA-RS++…

Page 33: Java Persistence: From NoSQL to HTML5s3-eu-west-1.amazonaws.com/presentations2013/27_presentation.pdf · 4 Beyond Relational and Java Persistence: From NoSQLNoSQL to Polyglot and

33 Beyond Relational and NoSQL to Polyglot and HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License 33 Java Persistence: From NoSQL to HTML5 | © 2013 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Summary

§  Java application needs are changing—and EclipseLink is evolving too! § Support for NoSQL and Polyglot Persistence § Support for building apps that go from Database to Browser

–  JSON Binding –  JAXB/JPA Fidelity –  JPA-RS automating RESTful persistence service


Recommended