SlideShare a Scribd company logo
„JPA 2.0“
New Features of JSR 317
JSR 317: Java Persistence API
• Specification Lead:
  Linda DeMichiel, Sun Microsystems, Inc.
• Expert Group:
  Adobe Systems Inc., akquinet tech@spree, BEA Systems, Adam Bien,
  DataDirect Technologies, Ericsson AB, Antonio Goncalves, IBM, Chris Maki,
  Oracle, OW2, Pramati Technologies, RedHat, SAP AG Sun Microsystems
  Inc., Sybase, TmaxSoft Inc., VMWare
• Referenzimplemention:
  EclipseLink 2.x, www.eclipse.org/eclipselink




                                                                              1
Goals
• Expanded O/R mappings
• Improved domain modeling capabilities
• Additions to the Java Persistence query language
• An API for criteria queries
• Standardization of configuration hints
• Additional contracts for detached entities and extended persistence
  contexts
• Support for validation via integration with the work of JSR 303




                                                                        2
@OneToMany / @ManyToOne
 @OneToMany
 @JoinColumn(name = "ID")
 private List<Editor> editors;




markus@eisele.net                3
@ElementCollection

 @ElementCollection
 private Set<String> websites = new HashSet();




markus@eisele.net                                4
@OrderColumn

 @OrderColumn(name="ED_ORDER")
 private List<Editor> editors;




markus@eisele.net                5
@MapKeyJoinColumn
 @JoinTable(name="ADRESSESS",
          joinColumns=
          @JoinColumn(name="AUTORID"),
          inverseJoinColumns=@JoinColumn(name="CONTACTID"))
 @MapKeyJoinColumn(name="ADRESSID")
 Map<Adress, Contactdetails> allAdressess;




markus@eisele.net                                             6
@Embeddable
 @Embedded
 PhoneNumber number;

 @ManyToOne
 PhoneServiceProvider provider;




markus@eisele.net                 7
@Access
@Entity @Access(FIELD)
public class PhoneNumber {
...
@Transient String localnumber;

@Access(PROPERTY)
protected double getInternationalNumber(Locale locale) {
return convertToIntNumber(localnumber);
}
...
}




                                                           8
Combined Primary Keys
 @Entity
 @IdClass(ArticlePK.class)
 public class Article {

 @Id Long id;
 @Id @ManyToOne Magazine magazine;
 @Id @ManyToOne Author author;
 }

 public class ArticlePK {
        Long id;
        Long magazine;
        Long author;
 }




markus@eisele.net                    9
Criteria API I
 // create / inject EntityManager
 EntityManager em = ...;

 // build Criteria Query
 CriteriaBuilder qb = em.getCriteriaBuilder();
 CriteriaQuery cq = qb.createQuery();
 Root<Author> autor = cq.from(Author.class);
 cq.select(author);

 // execute Criteria Query
 Query query = em.createQuery(cq);
 List result = query.getResultList();




markus@eisele.net                                10
Criteria API II
Root autor = cq.from(Author.class);
cq.where(qb.equal(author.get("name"), name));
cq.select(autor);




markus@eisele.net                               11
Metamodel API
@Entity public class Customer {
  @Id int custId;
  String name;
  ...
  @OneToMany(mappedBy="customer") Set<Order> orders;
  ...
}



import javax.persistence.metamodel.*;
@TypesafeMetamodel
public class Customer_ {
    public static volatile Attribute<Customer, Integer> custId;
    public static volatile Attribute<Customer, String> name;
    public static volatile Set<Customer, Order> orders;
    ...
}




                                                                  12
Metamodel API + Criteria API

cq.where(qb.equal(autor.get(Autor_.name), "name"));




markus@eisele.net                                     13
Bean Validation (JSR-303)
@Entity
public class Autor implements Serializable {
[…]
@NotNull
@Size(max=30)
private String name;
[…]
}


 •@NotNull
 •@Size.max
 •@Digits
 •@Min / @Max
 •@Future / @Past
 •@Size


markus@eisele.net                              14
LockModeTypes
.READ => LockModeType.OPTIMISTIC
.WRITE => LockModeType.OPTIMISTIC_FORCE_INCREMENT

NEW!:
LockModeType.PESSIMISTIC_READ (Repeatable Read)
LockModeType.PESSIMISTIC_WRITE (Serialized)
LockModeType.PESSIMISTIC_FORCE_INCREMENT




 markus@eisele.net                                  15
JPQL Enhancements
•   Timestamp
•   Non-polymorphic Queries
•   Collection Paramters in IN Expression
•   Ordered List Index
•   CASE Statement




                                            16
Second Level Cache

public interface Cache {
boolean contains(Class clz, Object primaryKey);
void evict(Class clz, Object primaryKey);
void evict(Class clz);
void evictAll();
}




 markus@eisele.net                                17
Links und Informationen
•   http://blog.eisele.net/
•   http://blogs.sun.com/ldemichiel/
•   http://www.jcp.org/en/jsr/detail?id=317
•   http://www.eclipse.org/eclipselink




markus@eisele.net                             18

More Related Content

What's hot

Creating data with the test data builder pattern
Creating data with the test data builder patternCreating data with the test data builder pattern
Creating data with the test data builder patternAlan Parkinson
 
Inversion of Control and Dependency Injection
Inversion of Control and Dependency InjectionInversion of Control and Dependency Injection
Inversion of Control and Dependency Injection
Dinesh Sharma
 
Dependency Injection Inversion Of Control And Unity
Dependency Injection Inversion Of Control And UnityDependency Injection Inversion Of Control And Unity
Dependency Injection Inversion Of Control And Unity
rainynovember12
 
iOS State Preservation and Restoration
iOS State Preservation and RestorationiOS State Preservation and Restoration
iOS State Preservation and Restoration
Robert Brown
 
Drupal 7 Entity & Entity API
Drupal 7 Entity & Entity APIDrupal 7 Entity & Entity API
Drupal 7 Entity & Entity API
均民 戴
 
AJAX
AJAXAJAX
Consume Spring Data Rest with Angularjs
Consume Spring Data Rest with AngularjsConsume Spring Data Rest with Angularjs
Consume Spring Data Rest with Angularjs
Corneil du Plessis
 
Using MongoDB with the .Net Framework
Using MongoDB with the .Net FrameworkUsing MongoDB with the .Net Framework
Using MongoDB with the .Net Framework
Stefano Paluello
 
Spring 3: What's New
Spring 3: What's NewSpring 3: What's New
Spring 3: What's NewTed Pennings
 
Cassandra rapid prototyping with achilles
Cassandra rapid prototyping with achillesCassandra rapid prototyping with achilles
Cassandra rapid prototyping with achilles
Duyhai Doan
 
Entity framework 6
Entity framework 6Entity framework 6
Entity framework 6
Ken Tucker
 
Hibernate complete Training
Hibernate complete TrainingHibernate complete Training
Hibernate complete Trainingsourabh aggarwal
 
Intro to IndexedDB (Beta)
Intro to IndexedDB (Beta)Intro to IndexedDB (Beta)
Intro to IndexedDB (Beta)
Mike West
 
Vaadin JPAContainer
Vaadin JPAContainerVaadin JPAContainer
Vaadin JPAContainer
cmkandemir
 
Entity Persistence with JPA
Entity Persistence with JPAEntity Persistence with JPA
Entity Persistence with JPA
Subin Sugunan
 
JPA Best Practices
JPA Best PracticesJPA Best Practices
JPA Best Practices
Carol McDonald
 
Java persistence api 2.1
Java persistence api 2.1Java persistence api 2.1
Java persistence api 2.1
Rakesh K. Cherukuri
 
Codebits 2012 - Fast relational web site construction.
Codebits 2012 - Fast relational web site construction.Codebits 2012 - Fast relational web site construction.
Codebits 2012 - Fast relational web site construction.Nelson Gomes
 

What's hot (19)

Creating data with the test data builder pattern
Creating data with the test data builder patternCreating data with the test data builder pattern
Creating data with the test data builder pattern
 
Inversion of Control and Dependency Injection
Inversion of Control and Dependency InjectionInversion of Control and Dependency Injection
Inversion of Control and Dependency Injection
 
Dependency Injection Inversion Of Control And Unity
Dependency Injection Inversion Of Control And UnityDependency Injection Inversion Of Control And Unity
Dependency Injection Inversion Of Control And Unity
 
iOS State Preservation and Restoration
iOS State Preservation and RestorationiOS State Preservation and Restoration
iOS State Preservation and Restoration
 
Drupal 7 Entity & Entity API
Drupal 7 Entity & Entity APIDrupal 7 Entity & Entity API
Drupal 7 Entity & Entity API
 
AJAX
AJAXAJAX
AJAX
 
Consume Spring Data Rest with Angularjs
Consume Spring Data Rest with AngularjsConsume Spring Data Rest with Angularjs
Consume Spring Data Rest with Angularjs
 
Using MongoDB with the .Net Framework
Using MongoDB with the .Net FrameworkUsing MongoDB with the .Net Framework
Using MongoDB with the .Net Framework
 
Spring 3: What's New
Spring 3: What's NewSpring 3: What's New
Spring 3: What's New
 
Cassandra rapid prototyping with achilles
Cassandra rapid prototyping with achillesCassandra rapid prototyping with achilles
Cassandra rapid prototyping with achilles
 
Entity framework 6
Entity framework 6Entity framework 6
Entity framework 6
 
Hibernate complete Training
Hibernate complete TrainingHibernate complete Training
Hibernate complete Training
 
Intro to IndexedDB (Beta)
Intro to IndexedDB (Beta)Intro to IndexedDB (Beta)
Intro to IndexedDB (Beta)
 
Vaadin JPAContainer
Vaadin JPAContainerVaadin JPAContainer
Vaadin JPAContainer
 
Entity Persistence with JPA
Entity Persistence with JPAEntity Persistence with JPA
Entity Persistence with JPA
 
JPA Best Practices
JPA Best PracticesJPA Best Practices
JPA Best Practices
 
Java persistence api 2.1
Java persistence api 2.1Java persistence api 2.1
Java persistence api 2.1
 
Codebits 2012 - Fast relational web site construction.
Codebits 2012 - Fast relational web site construction.Codebits 2012 - Fast relational web site construction.
Codebits 2012 - Fast relational web site construction.
 
C#
C#C#
C#
 

Viewers also liked

Hibernate - JPA @luce 5
Hibernate - JPA @luce 5Hibernate - JPA @luce 5
Hibernate - JPA @luce 5
Javier Gamarra
 
Introducción práctica a JPA2
Introducción práctica a JPA2Introducción práctica a JPA2
Introducción práctica a JPA2
jion1987
 
Introduction to JPA and Hibernate including examples
Introduction to JPA and Hibernate including examplesIntroduction to JPA and Hibernate including examples
Introduction to JPA and Hibernate including examples
ecosio GmbH
 
Quantum Entanglement - Cryptography and Communication
Quantum Entanglement - Cryptography and CommunicationQuantum Entanglement - Cryptography and Communication
Quantum Entanglement - Cryptography and Communication
Yi-Hsueh Tsai
 
The silent way
The silent wayThe silent way
The silent way
SusantiCotKala123
 
Shero Company profile,2016
Shero Company profile,2016Shero Company profile,2016
Shero Company profile,2016?? ?
 
BSidesNYC 2016 - An Adversarial View of SaaS Malware Sandboxes
BSidesNYC 2016 - An Adversarial View of SaaS Malware SandboxesBSidesNYC 2016 - An Adversarial View of SaaS Malware Sandboxes
BSidesNYC 2016 - An Adversarial View of SaaS Malware Sandboxes
Jason Trost
 
2016.10.28 Transistor 2 - engelsk tekst - sven age eriksen v.05 - Sven Åge ...
2016.10.28   Transistor 2 - engelsk tekst - sven age eriksen v.05 - Sven Åge ...2016.10.28   Transistor 2 - engelsk tekst - sven age eriksen v.05 - Sven Åge ...
2016.10.28 Transistor 2 - engelsk tekst - sven age eriksen v.05 - Sven Åge ...
Sven Åge Eriksen
 
FOOD ANYWHERE IS FOOD EVERYWHERE
FOOD ANYWHERE IS FOOD EVERYWHEREFOOD ANYWHERE IS FOOD EVERYWHERE
FOOD ANYWHERE IS FOOD EVERYWHERE
WINRED AKPLAGAH
 
iNut Limited Leather Beani Tablet Range
iNut Limited Leather Beani Tablet RangeiNut Limited Leather Beani Tablet Range
iNut Limited Leather Beani Tablet Rangeinutltd
 
осъдителна присъда кюстендилски окръжен съд
осъдителна присъда  кюстендилски окръжен съдосъдителна присъда  кюстендилски окръжен съд
осъдителна присъда кюстендилски окръжен съдKristiyan Petroff
 
Strategic Management Ch05
Strategic Management Ch05Strategic Management Ch05
Strategic Management Ch05
Chuong Nguyen
 
Building A Social Network Waa 1 17 07 V2 Draft
Building A Social Network   Waa   1 17 07 V2 DraftBuilding A Social Network   Waa   1 17 07 V2 Draft
Building A Social Network Waa 1 17 07 V2 Draft
Marshall Sponder
 
Zhao_Work samples
Zhao_Work samplesZhao_Work samples
Zhao_Work samplesYajing Zhao
 
Step Up 1 and 2 ppt
Step Up 1 and 2 pptStep Up 1 and 2 ppt
Step Up 1 and 2 ppt
guestcef88d
 
Zenoss Monitroing – zendmd Scripting Guide
Zenoss Monitroing – zendmd Scripting GuideZenoss Monitroing – zendmd Scripting Guide
Zenoss Monitroing – zendmd Scripting Guide
VCP Muthukrishna
 
dfasdfsdf
dfasdfsdfdfasdfsdf
dfasdfsdf
guest8637e17
 

Viewers also liked (20)

Jpa
JpaJpa
Jpa
 
Hibernate - JPA @luce 5
Hibernate - JPA @luce 5Hibernate - JPA @luce 5
Hibernate - JPA @luce 5
 
Jpa
JpaJpa
Jpa
 
Introducción práctica a JPA2
Introducción práctica a JPA2Introducción práctica a JPA2
Introducción práctica a JPA2
 
Introduction to JPA and Hibernate including examples
Introduction to JPA and Hibernate including examplesIntroduction to JPA and Hibernate including examples
Introduction to JPA and Hibernate including examples
 
Pdf Pai
Pdf PaiPdf Pai
Pdf Pai
 
Quantum Entanglement - Cryptography and Communication
Quantum Entanglement - Cryptography and CommunicationQuantum Entanglement - Cryptography and Communication
Quantum Entanglement - Cryptography and Communication
 
The silent way
The silent wayThe silent way
The silent way
 
Shero Company profile,2016
Shero Company profile,2016Shero Company profile,2016
Shero Company profile,2016
 
BSidesNYC 2016 - An Adversarial View of SaaS Malware Sandboxes
BSidesNYC 2016 - An Adversarial View of SaaS Malware SandboxesBSidesNYC 2016 - An Adversarial View of SaaS Malware Sandboxes
BSidesNYC 2016 - An Adversarial View of SaaS Malware Sandboxes
 
2016.10.28 Transistor 2 - engelsk tekst - sven age eriksen v.05 - Sven Åge ...
2016.10.28   Transistor 2 - engelsk tekst - sven age eriksen v.05 - Sven Åge ...2016.10.28   Transistor 2 - engelsk tekst - sven age eriksen v.05 - Sven Åge ...
2016.10.28 Transistor 2 - engelsk tekst - sven age eriksen v.05 - Sven Åge ...
 
FOOD ANYWHERE IS FOOD EVERYWHERE
FOOD ANYWHERE IS FOOD EVERYWHEREFOOD ANYWHERE IS FOOD EVERYWHERE
FOOD ANYWHERE IS FOOD EVERYWHERE
 
iNut Limited Leather Beani Tablet Range
iNut Limited Leather Beani Tablet RangeiNut Limited Leather Beani Tablet Range
iNut Limited Leather Beani Tablet Range
 
осъдителна присъда кюстендилски окръжен съд
осъдителна присъда  кюстендилски окръжен съдосъдителна присъда  кюстендилски окръжен съд
осъдителна присъда кюстендилски окръжен съд
 
Strategic Management Ch05
Strategic Management Ch05Strategic Management Ch05
Strategic Management Ch05
 
Building A Social Network Waa 1 17 07 V2 Draft
Building A Social Network   Waa   1 17 07 V2 DraftBuilding A Social Network   Waa   1 17 07 V2 Draft
Building A Social Network Waa 1 17 07 V2 Draft
 
Zhao_Work samples
Zhao_Work samplesZhao_Work samples
Zhao_Work samples
 
Step Up 1 and 2 ppt
Step Up 1 and 2 pptStep Up 1 and 2 ppt
Step Up 1 and 2 ppt
 
Zenoss Monitroing – zendmd Scripting Guide
Zenoss Monitroing – zendmd Scripting GuideZenoss Monitroing – zendmd Scripting Guide
Zenoss Monitroing – zendmd Scripting Guide
 
dfasdfsdf
dfasdfsdfdfasdfsdf
dfasdfsdf
 

Similar to New Features of JSR 317 (JPA 2.0)

Easy data-with-spring-data-jpa
Easy data-with-spring-data-jpaEasy data-with-spring-data-jpa
Easy data-with-spring-data-jpa
Staples
 
Requery overview
Requery overviewRequery overview
Requery overview
Sunghyouk Bae
 
S313431 JPA 2.0 Overview
S313431 JPA 2.0 OverviewS313431 JPA 2.0 Overview
S313431 JPA 2.0 Overview
Ludovic Champenois
 
Using the latest Java Persistence API 2 Features - Tech Days 2010 India
Using the latest Java Persistence API 2 Features - Tech Days 2010 IndiaUsing the latest Java Persistence API 2 Features - Tech Days 2010 India
Using the latest Java Persistence API 2 Features - Tech Days 2010 India
Arun Gupta
 
Learning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client DevelopersLearning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client Developers
Kathy Brown
 
NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020
Thodoris Bais
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLsintelliyole
 
Context and Dependency Injection
Context and Dependency InjectionContext and Dependency Injection
Context and Dependency Injection
Werner Keil
 
Crafting Evolvable Api Responses
Crafting Evolvable Api ResponsesCrafting Evolvable Api Responses
Crafting Evolvable Api Responses
darrelmiller71
 
CDI @javaonehyderabad
CDI @javaonehyderabadCDI @javaonehyderabad
CDI @javaonehyderabad
Prasad Subramanian
 
Suportando Aplicações Multi-tenancy com Java EE
Suportando Aplicações Multi-tenancy com Java EESuportando Aplicações Multi-tenancy com Java EE
Suportando Aplicações Multi-tenancy com Java EE
Rodrigo Cândido da Silva
 
Code decoupling from Symfony (and others frameworks) - PHP Conference Brasil ...
Code decoupling from Symfony (and others frameworks) - PHP Conference Brasil ...Code decoupling from Symfony (and others frameworks) - PHP Conference Brasil ...
Code decoupling from Symfony (and others frameworks) - PHP Conference Brasil ...
Miguel Gallardo
 
NoSQL Endgame Percona Live Online 2020
NoSQL Endgame Percona Live Online 2020NoSQL Endgame Percona Live Online 2020
NoSQL Endgame Percona Live Online 2020
Thodoris Bais
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
 
Mongoose and MongoDB 101
Mongoose and MongoDB 101Mongoose and MongoDB 101
Mongoose and MongoDB 101
Will Button
 
Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)
Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)
Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)
lennartkats
 
A Cocktail of Guice and Seam, the missing ingredients for Java EE 6
A Cocktail of Guice and Seam, the missing ingredients for Java EE 6A Cocktail of Guice and Seam, the missing ingredients for Java EE 6
A Cocktail of Guice and Seam, the missing ingredients for Java EE 6
Saltmarch Media
 
Scalable web application architecture
Scalable web application architectureScalable web application architecture
Scalable web application architecture
postrational
 
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
MongoDB
 

Similar to New Features of JSR 317 (JPA 2.0) (20)

Easy data-with-spring-data-jpa
Easy data-with-spring-data-jpaEasy data-with-spring-data-jpa
Easy data-with-spring-data-jpa
 
Requery overview
Requery overviewRequery overview
Requery overview
 
S313431 JPA 2.0 Overview
S313431 JPA 2.0 OverviewS313431 JPA 2.0 Overview
S313431 JPA 2.0 Overview
 
Using the latest Java Persistence API 2 Features - Tech Days 2010 India
Using the latest Java Persistence API 2 Features - Tech Days 2010 IndiaUsing the latest Java Persistence API 2 Features - Tech Days 2010 India
Using the latest Java Persistence API 2 Features - Tech Days 2010 India
 
Learning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client DevelopersLearning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client Developers
 
NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLs
 
Context and Dependency Injection
Context and Dependency InjectionContext and Dependency Injection
Context and Dependency Injection
 
Crafting Evolvable Api Responses
Crafting Evolvable Api ResponsesCrafting Evolvable Api Responses
Crafting Evolvable Api Responses
 
CDI @javaonehyderabad
CDI @javaonehyderabadCDI @javaonehyderabad
CDI @javaonehyderabad
 
Suportando Aplicações Multi-tenancy com Java EE
Suportando Aplicações Multi-tenancy com Java EESuportando Aplicações Multi-tenancy com Java EE
Suportando Aplicações Multi-tenancy com Java EE
 
Code decoupling from Symfony (and others frameworks) - PHP Conference Brasil ...
Code decoupling from Symfony (and others frameworks) - PHP Conference Brasil ...Code decoupling from Symfony (and others frameworks) - PHP Conference Brasil ...
Code decoupling from Symfony (and others frameworks) - PHP Conference Brasil ...
 
Green dao
Green daoGreen dao
Green dao
 
NoSQL Endgame Percona Live Online 2020
NoSQL Endgame Percona Live Online 2020NoSQL Endgame Percona Live Online 2020
NoSQL Endgame Percona Live Online 2020
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Mongoose and MongoDB 101
Mongoose and MongoDB 101Mongoose and MongoDB 101
Mongoose and MongoDB 101
 
Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)
Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)
Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)
 
A Cocktail of Guice and Seam, the missing ingredients for Java EE 6
A Cocktail of Guice and Seam, the missing ingredients for Java EE 6A Cocktail of Guice and Seam, the missing ingredients for Java EE 6
A Cocktail of Guice and Seam, the missing ingredients for Java EE 6
 
Scalable web application architecture
Scalable web application architectureScalable web application architecture
Scalable web application architecture
 
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
 

More from Markus Eisele

Sustainable Software Architecture - Open Tour DACH '22
Sustainable Software Architecture - Open Tour DACH '22Sustainable Software Architecture - Open Tour DACH '22
Sustainable Software Architecture - Open Tour DACH '22
Markus Eisele
 
Going from java message service (jms) to eda
Going from java message service (jms) to eda Going from java message service (jms) to eda
Going from java message service (jms) to eda
Markus Eisele
 
Let's be real. Quarkus in the wild.
Let's be real. Quarkus in the wild.Let's be real. Quarkus in the wild.
Let's be real. Quarkus in the wild.
Markus Eisele
 
What happens when unicorns drink coffee
What happens when unicorns drink coffeeWhat happens when unicorns drink coffee
What happens when unicorns drink coffee
Markus Eisele
 
Stateful on Stateless - The Future of Applications in the Cloud
Stateful on Stateless - The Future of Applications in the CloudStateful on Stateless - The Future of Applications in the Cloud
Stateful on Stateless - The Future of Applications in the Cloud
Markus Eisele
 
Java in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/MJava in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/M
Markus Eisele
 
Java in the Age of Containers and Serverless
Java in the Age of Containers and ServerlessJava in the Age of Containers and Serverless
Java in the Age of Containers and Serverless
Markus Eisele
 
Migrating from Java EE to cloud-native Reactive systems
Migrating from Java EE to cloud-native Reactive systemsMigrating from Java EE to cloud-native Reactive systems
Migrating from Java EE to cloud-native Reactive systems
Markus Eisele
 
Streaming to a new Jakarta EE / JOTB19
Streaming to a new Jakarta EE / JOTB19Streaming to a new Jakarta EE / JOTB19
Streaming to a new Jakarta EE / JOTB19
Markus Eisele
 
Cloud wars - A LavaOne discussion in seven slides
Cloud wars - A LavaOne discussion in seven slidesCloud wars - A LavaOne discussion in seven slides
Cloud wars - A LavaOne discussion in seven slides
Markus Eisele
 
Streaming to a new Jakarta EE
Streaming to a new Jakarta EEStreaming to a new Jakarta EE
Streaming to a new Jakarta EE
Markus Eisele
 
Reactive Integrations - Caveats and bumps in the road explained
Reactive Integrations - Caveats and bumps in the road explained  Reactive Integrations - Caveats and bumps in the road explained
Reactive Integrations - Caveats and bumps in the road explained
Markus Eisele
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolith
Markus Eisele
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolith
Markus Eisele
 
Stay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolithStay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolith
Markus Eisele
 
Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?
Markus Eisele
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolith Stay productive while slicing up the monolith
Stay productive while slicing up the monolith
Markus Eisele
 
Nine Neins - where Java EE will never take you
Nine Neins - where Java EE will never take youNine Neins - where Java EE will never take you
Nine Neins - where Java EE will never take you
Markus Eisele
 
How lagom helps to build real world microservice systems
How lagom helps to build real world microservice systemsHow lagom helps to build real world microservice systems
How lagom helps to build real world microservice systems
Markus Eisele
 
CQRS and Event Sourcing for Java Developers
CQRS and Event Sourcing for Java DevelopersCQRS and Event Sourcing for Java Developers
CQRS and Event Sourcing for Java Developers
Markus Eisele
 

More from Markus Eisele (20)

Sustainable Software Architecture - Open Tour DACH '22
Sustainable Software Architecture - Open Tour DACH '22Sustainable Software Architecture - Open Tour DACH '22
Sustainable Software Architecture - Open Tour DACH '22
 
Going from java message service (jms) to eda
Going from java message service (jms) to eda Going from java message service (jms) to eda
Going from java message service (jms) to eda
 
Let's be real. Quarkus in the wild.
Let's be real. Quarkus in the wild.Let's be real. Quarkus in the wild.
Let's be real. Quarkus in the wild.
 
What happens when unicorns drink coffee
What happens when unicorns drink coffeeWhat happens when unicorns drink coffee
What happens when unicorns drink coffee
 
Stateful on Stateless - The Future of Applications in the Cloud
Stateful on Stateless - The Future of Applications in the CloudStateful on Stateless - The Future of Applications in the Cloud
Stateful on Stateless - The Future of Applications in the Cloud
 
Java in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/MJava in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/M
 
Java in the Age of Containers and Serverless
Java in the Age of Containers and ServerlessJava in the Age of Containers and Serverless
Java in the Age of Containers and Serverless
 
Migrating from Java EE to cloud-native Reactive systems
Migrating from Java EE to cloud-native Reactive systemsMigrating from Java EE to cloud-native Reactive systems
Migrating from Java EE to cloud-native Reactive systems
 
Streaming to a new Jakarta EE / JOTB19
Streaming to a new Jakarta EE / JOTB19Streaming to a new Jakarta EE / JOTB19
Streaming to a new Jakarta EE / JOTB19
 
Cloud wars - A LavaOne discussion in seven slides
Cloud wars - A LavaOne discussion in seven slidesCloud wars - A LavaOne discussion in seven slides
Cloud wars - A LavaOne discussion in seven slides
 
Streaming to a new Jakarta EE
Streaming to a new Jakarta EEStreaming to a new Jakarta EE
Streaming to a new Jakarta EE
 
Reactive Integrations - Caveats and bumps in the road explained
Reactive Integrations - Caveats and bumps in the road explained  Reactive Integrations - Caveats and bumps in the road explained
Reactive Integrations - Caveats and bumps in the road explained
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolith
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolith
 
Stay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolithStay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolith
 
Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolith Stay productive while slicing up the monolith
Stay productive while slicing up the monolith
 
Nine Neins - where Java EE will never take you
Nine Neins - where Java EE will never take youNine Neins - where Java EE will never take you
Nine Neins - where Java EE will never take you
 
How lagom helps to build real world microservice systems
How lagom helps to build real world microservice systemsHow lagom helps to build real world microservice systems
How lagom helps to build real world microservice systems
 
CQRS and Event Sourcing for Java Developers
CQRS and Event Sourcing for Java DevelopersCQRS and Event Sourcing for Java Developers
CQRS and Event Sourcing for Java Developers
 

Recently uploaded

From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 

Recently uploaded (20)

From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 

New Features of JSR 317 (JPA 2.0)

  • 2. JSR 317: Java Persistence API • Specification Lead: Linda DeMichiel, Sun Microsystems, Inc. • Expert Group: Adobe Systems Inc., akquinet tech@spree, BEA Systems, Adam Bien, DataDirect Technologies, Ericsson AB, Antonio Goncalves, IBM, Chris Maki, Oracle, OW2, Pramati Technologies, RedHat, SAP AG Sun Microsystems Inc., Sybase, TmaxSoft Inc., VMWare • Referenzimplemention: EclipseLink 2.x, www.eclipse.org/eclipselink 1
  • 3. Goals • Expanded O/R mappings • Improved domain modeling capabilities • Additions to the Java Persistence query language • An API for criteria queries • Standardization of configuration hints • Additional contracts for detached entities and extended persistence contexts • Support for validation via integration with the work of JSR 303 2
  • 4. @OneToMany / @ManyToOne @OneToMany @JoinColumn(name = "ID") private List<Editor> editors; markus@eisele.net 3
  • 5. @ElementCollection @ElementCollection private Set<String> websites = new HashSet(); markus@eisele.net 4
  • 6. @OrderColumn @OrderColumn(name="ED_ORDER") private List<Editor> editors; markus@eisele.net 5
  • 7. @MapKeyJoinColumn @JoinTable(name="ADRESSESS", joinColumns= @JoinColumn(name="AUTORID"), inverseJoinColumns=@JoinColumn(name="CONTACTID")) @MapKeyJoinColumn(name="ADRESSID") Map<Adress, Contactdetails> allAdressess; markus@eisele.net 6
  • 8. @Embeddable @Embedded PhoneNumber number; @ManyToOne PhoneServiceProvider provider; markus@eisele.net 7
  • 9. @Access @Entity @Access(FIELD) public class PhoneNumber { ... @Transient String localnumber; @Access(PROPERTY) protected double getInternationalNumber(Locale locale) { return convertToIntNumber(localnumber); } ... } 8
  • 10. Combined Primary Keys @Entity @IdClass(ArticlePK.class) public class Article { @Id Long id; @Id @ManyToOne Magazine magazine; @Id @ManyToOne Author author; } public class ArticlePK { Long id; Long magazine; Long author; } markus@eisele.net 9
  • 11. Criteria API I // create / inject EntityManager EntityManager em = ...; // build Criteria Query CriteriaBuilder qb = em.getCriteriaBuilder(); CriteriaQuery cq = qb.createQuery(); Root<Author> autor = cq.from(Author.class); cq.select(author); // execute Criteria Query Query query = em.createQuery(cq); List result = query.getResultList(); markus@eisele.net 10
  • 12. Criteria API II Root autor = cq.from(Author.class); cq.where(qb.equal(author.get("name"), name)); cq.select(autor); markus@eisele.net 11
  • 13. Metamodel API @Entity public class Customer { @Id int custId; String name; ... @OneToMany(mappedBy="customer") Set<Order> orders; ... } import javax.persistence.metamodel.*; @TypesafeMetamodel public class Customer_ { public static volatile Attribute<Customer, Integer> custId; public static volatile Attribute<Customer, String> name; public static volatile Set<Customer, Order> orders; ... } 12
  • 14. Metamodel API + Criteria API cq.where(qb.equal(autor.get(Autor_.name), "name")); markus@eisele.net 13
  • 15. Bean Validation (JSR-303) @Entity public class Autor implements Serializable { […] @NotNull @Size(max=30) private String name; […] } •@NotNull •@Size.max •@Digits •@Min / @Max •@Future / @Past •@Size markus@eisele.net 14
  • 16. LockModeTypes .READ => LockModeType.OPTIMISTIC .WRITE => LockModeType.OPTIMISTIC_FORCE_INCREMENT NEW!: LockModeType.PESSIMISTIC_READ (Repeatable Read) LockModeType.PESSIMISTIC_WRITE (Serialized) LockModeType.PESSIMISTIC_FORCE_INCREMENT markus@eisele.net 15
  • 17. JPQL Enhancements • Timestamp • Non-polymorphic Queries • Collection Paramters in IN Expression • Ordered List Index • CASE Statement 16
  • 18. Second Level Cache public interface Cache { boolean contains(Class clz, Object primaryKey); void evict(Class clz, Object primaryKey); void evict(Class clz); void evictAll(); } markus@eisele.net 17
  • 19. Links und Informationen • http://blog.eisele.net/ • http://blogs.sun.com/ldemichiel/ • http://www.jcp.org/en/jsr/detail?id=317 • http://www.eclipse.org/eclipselink markus@eisele.net 18