SlideShare une entreprise Scribd logo
1  sur  27
JPA 2.0 What’s new? Emiel Paasschens Ref. implemenatie van EclipseLink is bijlange (met name Criteria API) nanognietaf, dus… GEEN Hands-On of tochwel…
Programma ,[object Object]
 Mixed @AccessType
 Derived Identifiers
 @ElementCollection
Undirectional @OneToMany / @OneToOne
 @OrderColumn
Shared Cache API
Locking
 JP QL
 Expression and criteria API
HandsOn?
Drankjeaan de bar,[object Object]
javax.persistence.jdbc.url 	driver-specific URL
javax.persistence.jdbc.user 	username used by database connection
javax.persistence.jdbc.password 	password for database connection validation  EE and SE: ,[object Object]
javax.persistence.query.timeoutvalue in milliseconds for query timeout
javax.persistence.validation.group.pre-persist	groups that are targeted for validation upon the pre-persist event
javax.persistence.validation.group.pre-update	groups that are targeted for validation upon the pre-update event
javax.persistence.validation.group.pre-remove	groups that are targeted for validation upon the pre-remove event,[object Object]
Can be mixed now! (instead of one or the other)At Entity/Class level the default Access type is defined
Can be set per attribute to differ from default: - on field (declaration) @Access(FIELD) access directly on instance variable by pers.prov.- on property (getter accessor) @Access(PROPERTY) access via accessor methods by pers. prov.
Be aware: @Access(PROPERTY):- validation/conversion logic in accessor methods is executed!- exceptions are catched and wrapped in PersistenceException, which is thrown. Transactions are marked for rollback.
The access type of an embeddable class is determined by the access type class in which it is embedded, independent of the containing class.,[object Object]
Derived Identifiers (1) Old JPA 1.0 way: ,[object Object]
 Require an additional foreign key field
 Indicate one of the mappings as read only

Contenu connexe

Tendances

Hibernate working with criteria- Basic Introduction
Hibernate working with criteria- Basic IntroductionHibernate working with criteria- Basic Introduction
Hibernate working with criteria- Basic IntroductionEr. Gaurav Kumar
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotationjavatwo2011
 
Hibernate complete Training
Hibernate complete TrainingHibernate complete Training
Hibernate complete Trainingsourabh aggarwal
 
Introduction to JPA (JPA version 2.0)
Introduction to JPA (JPA version 2.0)Introduction to JPA (JPA version 2.0)
Introduction to JPA (JPA version 2.0)ejlp12
 
Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 javatwo2011
 
Spring framework part 2
Spring framework part 2Spring framework part 2
Spring framework part 2Haroon Idrees
 
JAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun Gupta
JAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun GuptaJAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun Gupta
JAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun GuptaJAX London
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right wayThibaud Desodt
 

Tendances (19)

Hibernate working with criteria- Basic Introduction
Hibernate working with criteria- Basic IntroductionHibernate working with criteria- Basic Introduction
Hibernate working with criteria- Basic Introduction
 
Jpa 2.1 Application Development
Jpa 2.1 Application DevelopmentJpa 2.1 Application Development
Jpa 2.1 Application Development
 
Jpa
JpaJpa
Jpa
 
hibernate with JPA
hibernate with JPAhibernate with JPA
hibernate with JPA
 
Java persistence api 2.1
Java persistence api 2.1Java persistence api 2.1
Java persistence api 2.1
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
Dependency Injection
Dependency InjectionDependency Injection
Dependency Injection
 
Hibernate complete Training
Hibernate complete TrainingHibernate complete Training
Hibernate complete Training
 
JPA and Hibernate
JPA and HibernateJPA and Hibernate
JPA and Hibernate
 
CDI @javaonehyderabad
CDI @javaonehyderabadCDI @javaonehyderabad
CDI @javaonehyderabad
 
TY.BSc.IT Java QB U1
TY.BSc.IT Java QB U1TY.BSc.IT Java QB U1
TY.BSc.IT Java QB U1
 
Introduction to JPA (JPA version 2.0)
Introduction to JPA (JPA version 2.0)Introduction to JPA (JPA version 2.0)
Introduction to JPA (JPA version 2.0)
 
Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望
 
Spring framework part 2
Spring framework part 2Spring framework part 2
Spring framework part 2
 
JAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun Gupta
JAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun GuptaJAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun Gupta
JAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun Gupta
 
Jstl 8
Jstl 8Jstl 8
Jstl 8
 
Hibernate III
Hibernate IIIHibernate III
Hibernate III
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right way
 
Hibernate in Nutshell
Hibernate in NutshellHibernate in Nutshell
Hibernate in Nutshell
 

En vedette

Perbup 51 tahun 2016 pengembangan kemitraan wirausaha muda di kabupaten pes...
Perbup 51 tahun 2016   pengembangan kemitraan wirausaha muda di kabupaten pes...Perbup 51 tahun 2016   pengembangan kemitraan wirausaha muda di kabupaten pes...
Perbup 51 tahun 2016 pengembangan kemitraan wirausaha muda di kabupaten pes...efendi suyanto
 
quickguide-einnovator-4-cloudfoundry
quickguide-einnovator-4-cloudfoundryquickguide-einnovator-4-cloudfoundry
quickguide-einnovator-4-cloudfoundryjorgesimao71
 
자바병렬프로그래밍 9.gui 애플리케이션
자바병렬프로그래밍 9.gui 애플리케이션자바병렬프로그래밍 9.gui 애플리케이션
자바병렬프로그래밍 9.gui 애플리케이션Choonghyun Yang
 
Launching a product in an Overseas market(Packaged Drinking Water in Indonesia)
Launching a product in an Overseas market(Packaged Drinking Water in Indonesia)Launching a product in an Overseas market(Packaged Drinking Water in Indonesia)
Launching a product in an Overseas market(Packaged Drinking Water in Indonesia)Shaurya Vikram Singh
 
What’s New in Documentum 7.3
What’s New in Documentum 7.3What’s New in Documentum 7.3
What’s New in Documentum 7.3Michael Mohen
 
Benefit-risk Assessment for Including Dairy Foods in the Diet
Benefit-risk Assessment for Including Dairy Foods in the DietBenefit-risk Assessment for Including Dairy Foods in the Diet
Benefit-risk Assessment for Including Dairy Foods in the DietNicoleGeurin
 
Bioaccumulation - Ecosystems
Bioaccumulation - EcosystemsBioaccumulation - Ecosystems
Bioaccumulation - EcosystemsHaileybury
 
Industrial Programming Java - Lection Pack 02 - Distributed applications - La...
Industrial Programming Java - Lection Pack 02 - Distributed applications - La...Industrial Programming Java - Lection Pack 02 - Distributed applications - La...
Industrial Programming Java - Lection Pack 02 - Distributed applications - La...Fedor Lavrentyev
 
Industrial Programming Java - Lection Pack 01 - Building an application - Lav...
Industrial Programming Java - Lection Pack 01 - Building an application - Lav...Industrial Programming Java - Lection Pack 01 - Building an application - Lav...
Industrial Programming Java - Lection Pack 01 - Building an application - Lav...Fedor Lavrentyev
 
Enviornmental protection Act 1986
Enviornmental protection Act 1986Enviornmental protection Act 1986
Enviornmental protection Act 1986Charu Jaiswal
 
Restaurant management in Russia
Restaurant management in RussiaRestaurant management in Russia
Restaurant management in RussiaAnatoly Odintsov
 

En vedette (17)

Perbup 51 tahun 2016 pengembangan kemitraan wirausaha muda di kabupaten pes...
Perbup 51 tahun 2016   pengembangan kemitraan wirausaha muda di kabupaten pes...Perbup 51 tahun 2016   pengembangan kemitraan wirausaha muda di kabupaten pes...
Perbup 51 tahun 2016 pengembangan kemitraan wirausaha muda di kabupaten pes...
 
quickguide-einnovator-4-cloudfoundry
quickguide-einnovator-4-cloudfoundryquickguide-einnovator-4-cloudfoundry
quickguide-einnovator-4-cloudfoundry
 
Damen4Design
Damen4DesignDamen4Design
Damen4Design
 
자바병렬프로그래밍 9.gui 애플리케이션
자바병렬프로그래밍 9.gui 애플리케이션자바병렬프로그래밍 9.gui 애플리케이션
자바병렬프로그래밍 9.gui 애플리케이션
 
Launching a product in an Overseas market(Packaged Drinking Water in Indonesia)
Launching a product in an Overseas market(Packaged Drinking Water in Indonesia)Launching a product in an Overseas market(Packaged Drinking Water in Indonesia)
Launching a product in an Overseas market(Packaged Drinking Water in Indonesia)
 
What’s New in Documentum 7.3
What’s New in Documentum 7.3What’s New in Documentum 7.3
What’s New in Documentum 7.3
 
Spring boot
Spring bootSpring boot
Spring boot
 
Benefit-risk Assessment for Including Dairy Foods in the Diet
Benefit-risk Assessment for Including Dairy Foods in the DietBenefit-risk Assessment for Including Dairy Foods in the Diet
Benefit-risk Assessment for Including Dairy Foods in the Diet
 
Crop production
Crop productionCrop production
Crop production
 
Lecture 42
Lecture 42Lecture 42
Lecture 42
 
Battle of plassey
Battle of plasseyBattle of plassey
Battle of plassey
 
Bioaccumulation - Ecosystems
Bioaccumulation - EcosystemsBioaccumulation - Ecosystems
Bioaccumulation - Ecosystems
 
Industrial Programming Java - Lection Pack 02 - Distributed applications - La...
Industrial Programming Java - Lection Pack 02 - Distributed applications - La...Industrial Programming Java - Lection Pack 02 - Distributed applications - La...
Industrial Programming Java - Lection Pack 02 - Distributed applications - La...
 
Industrial Programming Java - Lection Pack 01 - Building an application - Lav...
Industrial Programming Java - Lection Pack 01 - Building an application - Lav...Industrial Programming Java - Lection Pack 01 - Building an application - Lav...
Industrial Programming Java - Lection Pack 01 - Building an application - Lav...
 
Enviornmental protection Act 1986
Enviornmental protection Act 1986Enviornmental protection Act 1986
Enviornmental protection Act 1986
 
Restaurant management in Russia
Restaurant management in RussiaRestaurant management in Russia
Restaurant management in Russia
 
Internet security
Internet securityInternet security
Internet security
 

Similaire à JPA 2.0

Executing Sql Commands
Executing Sql CommandsExecuting Sql Commands
Executing Sql Commandsphanleson
 
Executing Sql Commands
Executing Sql CommandsExecuting Sql Commands
Executing Sql Commandsleminhvuong
 
Codecamp iasi-26 nov 2011-what's new in jpa 2.0
Codecamp iasi-26 nov 2011-what's new in jpa 2.0Codecamp iasi-26 nov 2011-what's new in jpa 2.0
Codecamp iasi-26 nov 2011-what's new in jpa 2.0Codecamp Romania
 
JDBC for CSQL Database
JDBC for CSQL DatabaseJDBC for CSQL Database
JDBC for CSQL Databasejitendral
 
Tk2323 lecture 9 api json
Tk2323 lecture 9   api jsonTk2323 lecture 9   api json
Tk2323 lecture 9 api jsonMengChun Lam
 
Unit test candidate solutions
Unit test candidate solutionsUnit test candidate solutions
Unit test candidate solutionsbenewu
 
Top 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesTop 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesCarol McDonald
 
Accelerated data access
Accelerated data accessAccelerated data access
Accelerated data accessgordonyorke
 
Introduction to Spring MVC
Introduction to Spring MVCIntroduction to Spring MVC
Introduction to Spring MVCRichard Paul
 
Designing REST API automation tests in Kotlin
Designing REST API automation tests in KotlinDesigning REST API automation tests in Kotlin
Designing REST API automation tests in KotlinDmitriy Sobko
 
Alexey Tsoy Meta Programming in C++ 16.11.17
Alexey Tsoy Meta Programming in C++ 16.11.17Alexey Tsoy Meta Programming in C++ 16.11.17
Alexey Tsoy Meta Programming in C++ 16.11.17LogeekNightUkraine
 
Asp.net MVC - Course 2
Asp.net MVC - Course 2Asp.net MVC - Course 2
Asp.net MVC - Course 2erdemergin
 

Similaire à JPA 2.0 (20)

JDBC – Java Database Connectivity
JDBC – Java Database ConnectivityJDBC – Java Database Connectivity
JDBC – Java Database Connectivity
 
Executing Sql Commands
Executing Sql CommandsExecuting Sql Commands
Executing Sql Commands
 
Executing Sql Commands
Executing Sql CommandsExecuting Sql Commands
Executing Sql Commands
 
Codecamp iasi-26 nov 2011-what's new in jpa 2.0
Codecamp iasi-26 nov 2011-what's new in jpa 2.0Codecamp iasi-26 nov 2011-what's new in jpa 2.0
Codecamp iasi-26 nov 2011-what's new in jpa 2.0
 
Sqlapi0.1
Sqlapi0.1Sqlapi0.1
Sqlapi0.1
 
ORM JPA
ORM JPAORM JPA
ORM JPA
 
JDBC for CSQL Database
JDBC for CSQL DatabaseJDBC for CSQL Database
JDBC for CSQL Database
 
Tk2323 lecture 9 api json
Tk2323 lecture 9   api jsonTk2323 lecture 9   api json
Tk2323 lecture 9 api json
 
Java beans
Java beansJava beans
Java beans
 
Java 17
Java 17Java 17
Java 17
 
Sql injection
Sql injectionSql injection
Sql injection
 
Unit test candidate solutions
Unit test candidate solutionsUnit test candidate solutions
Unit test candidate solutions
 
Top 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesTop 10 Web Security Vulnerabilities
Top 10 Web Security Vulnerabilities
 
Accelerated data access
Accelerated data accessAccelerated data access
Accelerated data access
 
Jdbc
JdbcJdbc
Jdbc
 
Introduction to Spring MVC
Introduction to Spring MVCIntroduction to Spring MVC
Introduction to Spring MVC
 
Designing REST API automation tests in Kotlin
Designing REST API automation tests in KotlinDesigning REST API automation tests in Kotlin
Designing REST API automation tests in Kotlin
 
Jdbc ppt
Jdbc pptJdbc ppt
Jdbc ppt
 
Alexey Tsoy Meta Programming in C++ 16.11.17
Alexey Tsoy Meta Programming in C++ 16.11.17Alexey Tsoy Meta Programming in C++ 16.11.17
Alexey Tsoy Meta Programming in C++ 16.11.17
 
Asp.net MVC - Course 2
Asp.net MVC - Course 2Asp.net MVC - Course 2
Asp.net MVC - Course 2
 

Plus de Emiel Paasschens

ACM Patterns and Oracle BPM Suite Best Practises
ACM Patterns and Oracle BPM Suite Best PractisesACM Patterns and Oracle BPM Suite Best Practises
ACM Patterns and Oracle BPM Suite Best PractisesEmiel Paasschens
 
Introduction of Java 8 with emphasis on Lambda Expressions and Streams
Introduction of Java 8 with emphasis on Lambda Expressions and StreamsIntroduction of Java 8 with emphasis on Lambda Expressions and Streams
Introduction of Java 8 with emphasis on Lambda Expressions and StreamsEmiel Paasschens
 
Boost JD Edwards EnterpriseOne with Oracle SOA Suite for maximum business value
Boost JD Edwards EnterpriseOne with Oracle SOA Suite for maximum business valueBoost JD Edwards EnterpriseOne with Oracle SOA Suite for maximum business value
Boost JD Edwards EnterpriseOne with Oracle SOA Suite for maximum business valueEmiel Paasschens
 
XML Business Rules Validation with Schematron
XML Business Rules Validation with SchematronXML Business Rules Validation with Schematron
XML Business Rules Validation with SchematronEmiel Paasschens
 
Cookbook Oracle SOA Business Rules
Cookbook Oracle SOA Business RulesCookbook Oracle SOA Business Rules
Cookbook Oracle SOA Business RulesEmiel Paasschens
 

Plus de Emiel Paasschens (6)

ACM Patterns and Oracle BPM Suite Best Practises
ACM Patterns and Oracle BPM Suite Best PractisesACM Patterns and Oracle BPM Suite Best Practises
ACM Patterns and Oracle BPM Suite Best Practises
 
Schematron
SchematronSchematron
Schematron
 
Introduction of Java 8 with emphasis on Lambda Expressions and Streams
Introduction of Java 8 with emphasis on Lambda Expressions and StreamsIntroduction of Java 8 with emphasis on Lambda Expressions and Streams
Introduction of Java 8 with emphasis on Lambda Expressions and Streams
 
Boost JD Edwards EnterpriseOne with Oracle SOA Suite for maximum business value
Boost JD Edwards EnterpriseOne with Oracle SOA Suite for maximum business valueBoost JD Edwards EnterpriseOne with Oracle SOA Suite for maximum business value
Boost JD Edwards EnterpriseOne with Oracle SOA Suite for maximum business value
 
XML Business Rules Validation with Schematron
XML Business Rules Validation with SchematronXML Business Rules Validation with Schematron
XML Business Rules Validation with Schematron
 
Cookbook Oracle SOA Business Rules
Cookbook Oracle SOA Business RulesCookbook Oracle SOA Business Rules
Cookbook Oracle SOA Business Rules
 

Dernier

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 

Dernier (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 

JPA 2.0

  • 1. JPA 2.0 What’s new? Emiel Paasschens Ref. implemenatie van EclipseLink is bijlange (met name Criteria API) nanognietaf, dus… GEEN Hands-On of tochwel…
  • 2.
  • 11. Expression and criteria API
  • 13.
  • 16.
  • 18. javax.persistence.validation.group.pre-persist groups that are targeted for validation upon the pre-persist event
  • 19. javax.persistence.validation.group.pre-update groups that are targeted for validation upon the pre-update event
  • 20.
  • 21. Can be mixed now! (instead of one or the other)At Entity/Class level the default Access type is defined
  • 22. Can be set per attribute to differ from default: - on field (declaration) @Access(FIELD) access directly on instance variable by pers.prov.- on property (getter accessor) @Access(PROPERTY) access via accessor methods by pers. prov.
  • 23. Be aware: @Access(PROPERTY):- validation/conversion logic in accessor methods is executed!- exceptions are catched and wrapped in PersistenceException, which is thrown. Transactions are marked for rollback.
  • 24.
  • 25.
  • 26. Require an additional foreign key field
  • 27. Indicate one of the mappings as read only
  • 28. Duplicate mapping info@Entity public class Part { @Id Integer partNo; @Column(name=“SUPP_ID”) @Id Integer suppId; ... @ManyToOne(insertable=false, updatable=false) @JoinColumn(name=“SUPP_ID”) Supplier supplier; ... }
  • 29.
  • 30.
  • 31.
  • 32. Can be combined with existing @Column (only with basic type) and @OrderBy annotations
  • 33.
  • 34. Undirectional @OneToMany / @OneToOne @OneToMany Mapping with @JoinColumn on parent side:   @Entity public class Vehicle { ... @OneToMany @JoinColumn(name=”VEHIC”) List<Parts> parts; ... }   Also applies to @OneToOne With JPA 1.0 you had to define relation on both sides (necessary to specify columnname)
  • 35.
  • 36. Stores the order in separate DB column, so preferable do not use!  insert object at begin of list causes lots of updates!
  • 37.
  • 38.
  • 39. evict?  how about objects pointing to these evicting instances…
  • 41.
  • 42.
  • 43.
  • 44. CLASS() in WHERE clause (kind of JP QL ‘instanceof’):SELECT e FROM Employee e WHERE CLASS(e) = FullTimeEmployee
  • 45. Collection param from IN:SELECT e FROM Employee eWHERE e.id IN [:selectedIds]
  • 46.
  • 47.
  • 48. Object Model totally been refactored (no more DomainObject or QueryDefinition objects)
  • 49. CriteriaQueryrepresents JP QL in an object way
  • 50. The query Root object defined by the from method and is analog to the “Employee e” in JP QL: SELECT e FROM Employee e
  • 51. new Query object is created by passing CriteriaQuery to em.createQuery.
  • 52.
  • 53. Also applies for and(), or() and not(), methods of the QueryBuilder API
  • 54. The same accounts for methods in the select: max(), min(), sum(), prod(), etc
  • 55. But the orderBy(), groupBy() and having() are methods of the CriteriaQueryobject!
  • 56. And function desc() and asc() are methods of the QueryBuilderobject !!Pro is type safe and no need any more to execute logic code twice when dynamically constructing a query comparing with JP QL (where one time parse is needed to construct the query query and one more to bind the bind params). Con : quite complex and hard to read, so from maintenance perspective…
  • 57. Expression & criteria API (code) Query q = em.createQuery(“SELECT a FROM Account a”); QueryBuilderqb = em.getQueryBuilder();CriteriaQuerycq = qb.create(); Root<Account> account = cq.from(Account.class); cq.select(account); Query q = em.createQuery(cq); List<Account> list = q. getResultList();  
  • 58. Expression & criteria API (code) SELECT c.name FROM Customer c JOIN c.orders o JOIN o.lineitemsi WHERE i.product.productType = ‘printer’ CriteriaQuery q = qb.create(); Root<Customer> cust = q.from(Customer.class); Join<Customer, Order> order = cust.join(Customer_.orders); Join<Order, Item> item = order.join(Order_.lineitems); q.select(cust.get(Customer_.name)) .where(qb.equal(item.get(Item_.product).get(Product_.productType), "printer"));
  • 59. Expression & criteria API (code) Joins can be chained, resulting into:  CriteriaQueryq = qb.create(); Root<Customer> cust = q.from(Customer.class); Join<Order,Item> item = cust.join(Customer_.orders).join(Order_.lineitems); q.select(cust.get(Customer_.name)) .where(qb.equal(item.get(Item_.product).get(Product_.productType), "printer"));    Outer join with param on the join: SELECT c FROM Customer c LEFT JOIN c.orders o WHERE c.status = 1   CriteriaQuery q = qb.create(); Root<Customer> cust = q.from(Customer.class); Join<Customer, Order> order = cust.join(Customer_.orders, JoinType.LEFT); q.where(qb.equal(cust.get(Customer_.status), 1)).select(cust);
  • 60. Expression & criteria API (code) Example with ContactInfo as Embeddable class containing address and set of Phones.   SELECT p.vendor FROM Employee e JOIN e.contactInfo.phones p WHERE e.contactInfo.address.zipcode = '95054'   CriteriaQuery q = qb.create(); Root<Employee> emp = q.from(Employee.class); Join<ContactInfo, Phone> phone = emp.join(Employee_.contactInfo).join(ContactInfo_.phones); q.where(qb.equal(emp.get(Employee_.contactInfo).get( ContactInfo_.address).get(Address_.zipcode), "95054")).select(phone.get(Phone_.vendor));
  • 61. Expression & criteria API (code) Example with subquery using all:SELECT emp FROM Employee emp WHERE emp.salary > ALL (SELECT m.salary FROM Manager m WHERE m.department = emp.department)    // create CriteriaQuery instance, with root Employee CriteriaQuery q = qb.create(); Root<Employee> emp = q.from(Employee.class);   // create Subquery instance, with root Manager Subquery<BigDecimal> sq = q.subquery(BigDecimal.class); Root<Manager> manager = sq.from(Manager.class); sq.select(manager.get(Manager_.salary)); sq.where(qb.equal(manager.get(Manager_.dept), emp.get(Employee_.dept)));   // an all expression is applied to the subquery result q.select(emp).where(qb.gt(emp.get(Employee_.salary), qb.all(sq)));
  • 62. Expression & criteria API (code) Example with order by: SELECT o.quantity, a.zipcode FROM Customer c JOIN c.orders o JOIN c.address a WHERE a.state = 'CA’ ORDER BY o.quantity, a.zipcode CriteriaQuery q = qb.create(); Root<Customer> c = q.from(Customer.class); Join<Customer, Order> o = c.join(Customer_.orders); Join<Customer, Address> a = c.join(Customer_.address); q.where(qb.equal(a.get(Address_.state), "CA")); q.orderBy(qb.asc(o.get(Order_.quantity)), qb.asc(a.get(Address_.zipcode))); q.select(o.get(Order_.quantity), a.get(Address_.zipcode));
  • 63. Expression & criteria API (code) Example with group by and having: SELECT c.status, AVG(c.filledOrderCount), COUNT(c) FROM Customer c GROUP BY c.status HAVING c.status IN (1, 2) CriteriaQuery q = qb.create(); Root<Customer> cust = q.from(Customer.class); q.groupBy(cust.get(Customer_.status)); q.having(qb.in(cust.get(Customer_.status)).value(1).value(2)); q.select(cust.get(Customer_.status), qb.avg(cust.get(Customer_.filledOrderCount)), qb.count(cust));
  • 64.
  • 65. Training door Oracle ACE’s en ACE Director

Notes de l'éditeur

  1. These defined properties must be implemented by each vendor (aside from vendor specific properties)
  2. Let op! Mark @Transient anderswordtdezewegens default FIELD access ookgepersisteerd.