SlideShare a Scribd company logo
Hibernate ORM
& JPA Overview
Brett Meyer
Senior Software Engineer
Hibernate ORM, Red Hat
Brett Meyer
• JBoss Overlord (SOA Governance)
• Hibernate ORM
– ORM 4 & 5 development
– Hibernate OSGi
– Developer community engagement
– Red Hat support, Hibernate engineering lead
• Other contributions
– Apache Camel
– Infinispan
• Contact me
– @brettemeyer or +brettmeyer
– Freenode IRC: brmeyer
github.com/brmeyer
/HibernateDemos
slideshare.net/brmeyer
ORM? JPA?
• ORM: Object/Relational Mapping
• JPA: Java Persistence API
• Hibernate ORM provides its own native
API, in addition to full JPA support
• Annotations and XML
Overview
• JDBC
• Why ORM?
• Why JPA?
• Hibernate ORM
• Demos
JDBC
JDBC
• “Java Database Connectivity”
• Java SE library for querying/updating database
data
• Mainly focused on relational DBs
• Manages Connections to the DB, either directly
or through a 3rd
party “Connection Pool”
• Database vendors provide their own JDBC
driver libraries
JDBC (cont'd)
• API abstracts common interactions,
data types, etc.
• Execute SQL through “Statements”
• Query returns received through
“ResultSets”
• Transactional
• Cacheable
JDBC Demo
Why ORM?
ORM
• “Object/Relational Mapping”
• “Persistence”: Data objects outlive the
JVM app
• Maps Java POJOs to relational
databases (one type of “persistence”)
Why ORM?
• “Domain Model” pattern
– Focus on business concepts, not relational DB
structure
– Interconnected objects
– Each object is a meaningful individual/concept
– OO concepts: inheritance, object identity, etc.
– Navigate data by walking the object graph, not the
explicit relational model
Why ORM? (cont'd)
• Increased development speed &
reduced code
– No “by-hand” mapping of JDBC ResultSets
to POJOs
– Less work synchronizing code with
relational DB changes
– Less JBDC boilerplate (repetitious CRUD)
– Focus on business logic
Why ORM? (cont'd)
• Portability
– Mostly DB independent (exception: some
types of features, identifier generation,
etc.)
– Query abstractions (OO APIs, OO-
structured languages, etc.)
– Vendor-specific SQL is auto generated
Why ORM? (cont'd)
• Performance
– Granular control of “when”, “how”, “how much”
data/relationships to load, based on the business logic
– Object and query caching
• Concurrency & multiple-tenancy
• Transactional
• Scalable
• Extendable (many types of extension points)
ORM FUD
• “ORMs are slow and generally awful.”
– http://www.slideshare.net/brmeyer/hibernate-orm
• “ORMs are over complicated.”
– Back in the EJB/XML days, maybe.
– Annotations FTW!
ORM Demo
Why JPA?
JPA
• “Java Persistence API”
• JSR 317 (2.0) & JSR 338 (2.1)
• Included in both Java SE & Java EE
• Provides portability between JPA
implementations (with caveats)
• Same ORM concepts, but standardized
API and query language (JPQL)
JPA Demo
Hibernate ORM
Hibernate ORM
• JPA implementation and 100% TCK compliant
• “Native” features
– HQL (Hibernate Query Language): similar to JPQL, but
extended
– Criteria API
– Performance: Fetch strategies, caching, bytecode
enhancement, etc.
– Extension points
– Rich tool set (schema generation/validation, etc.)
• Part of JBoss Community
Hibernate Family
• Not just ORM
• Hibernate Spatial
• Hibernate Envers
• Hibernate OSGi
• Hibernate Search
• Hibernate OGM
• Hibernate Validator
• Hibernate Shards
• http://www.slideshare.net/brmeyer/hibernate-orm-features
We've barely
scratched the
surface!
How to Help:
hibernate.org
/orm/contribute
QUESTIONS?
• Q&A
• Freenode IRC: brmeyer
• @brettemeyer
• +brettmeyer

More Related Content

What's hot (20)

Hibernate ppt
Hibernate pptHibernate ppt
Hibernate ppt
Aneega
 
Spring Framework - Spring Security
Spring Framework - Spring SecuritySpring Framework - Spring Security
Spring Framework - Spring Security
Dzmitry Naskou
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By Step
Guo Albert
 
Spring Data JPA
Spring Data JPASpring Data JPA
Spring Data JPA
Knoldus Inc.
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debate
Restlet
 
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
Edureka!
 
Clean Pragmatic Architecture - Avoiding a Monolith
Clean Pragmatic Architecture - Avoiding a MonolithClean Pragmatic Architecture - Avoiding a Monolith
Clean Pragmatic Architecture - Avoiding a Monolith
Victor Rentea
 
Spring - Part 1 - IoC, Di and Beans
Spring - Part 1 - IoC, Di and Beans Spring - Part 1 - IoC, Di and Beans
Spring - Part 1 - IoC, Di and Beans
Hitesh-Java
 
REST API 설계
REST API 설계REST API 설계
REST API 설계
Terry Cho
 
Search and analyze your data with elasticsearch
Search and analyze your data with elasticsearchSearch and analyze your data with elasticsearch
Search and analyze your data with elasticsearch
Anton Udovychenko
 
Vertical Slicing Architectures
Vertical Slicing ArchitecturesVertical Slicing Architectures
Vertical Slicing Architectures
Victor Rentea
 
JPA and Hibernate
JPA and HibernateJPA and Hibernate
JPA and Hibernate
elliando dias
 
API Design- Best Practices
API Design-   Best PracticesAPI Design-   Best Practices
API Design- Best Practices
Prakash Bhandari
 
Spring framework in depth
Spring framework in depthSpring framework in depth
Spring framework in depth
Vinay Kumar
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
Emprovise
 
Rest api standards and best practices
Rest api standards and best practicesRest api standards and best practices
Rest api standards and best practices
Ankita Mahajan
 
Spring data jpa
Spring data jpaSpring data jpa
Spring data jpa
Jeevesh Pandey
 
Spring boot introduction
Spring boot introductionSpring boot introduction
Spring boot introduction
Rasheed Waraich
 
Java Logging
Java LoggingJava Logging
Java Logging
Zeeshan Bilal
 
Spring Framework - MVC
Spring Framework - MVCSpring Framework - MVC
Spring Framework - MVC
Dzmitry Naskou
 
Hibernate ppt
Hibernate pptHibernate ppt
Hibernate ppt
Aneega
 
Spring Framework - Spring Security
Spring Framework - Spring SecuritySpring Framework - Spring Security
Spring Framework - Spring Security
Dzmitry Naskou
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By Step
Guo Albert
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debate
Restlet
 
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
Edureka!
 
Clean Pragmatic Architecture - Avoiding a Monolith
Clean Pragmatic Architecture - Avoiding a MonolithClean Pragmatic Architecture - Avoiding a Monolith
Clean Pragmatic Architecture - Avoiding a Monolith
Victor Rentea
 
Spring - Part 1 - IoC, Di and Beans
Spring - Part 1 - IoC, Di and Beans Spring - Part 1 - IoC, Di and Beans
Spring - Part 1 - IoC, Di and Beans
Hitesh-Java
 
REST API 설계
REST API 설계REST API 설계
REST API 설계
Terry Cho
 
Search and analyze your data with elasticsearch
Search and analyze your data with elasticsearchSearch and analyze your data with elasticsearch
Search and analyze your data with elasticsearch
Anton Udovychenko
 
Vertical Slicing Architectures
Vertical Slicing ArchitecturesVertical Slicing Architectures
Vertical Slicing Architectures
Victor Rentea
 
Spring framework in depth
Spring framework in depthSpring framework in depth
Spring framework in depth
Vinay Kumar
 
Rest api standards and best practices
Rest api standards and best practicesRest api standards and best practices
Rest api standards and best practices
Ankita Mahajan
 
Spring boot introduction
Spring boot introductionSpring boot introduction
Spring boot introduction
Rasheed Waraich
 
Spring Framework - MVC
Spring Framework - MVCSpring Framework - MVC
Spring Framework - MVC
Dzmitry Naskou
 

Similar to ORM, JPA, & Hibernate Overview (20)

hibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdfhibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdf
Patiento Del Mar
 
Introduction to Object-Relational Mapping
Introduction to Object-Relational MappingIntroduction to Object-Relational Mapping
Introduction to Object-Relational Mapping
Ali Shakiba
 
Scaling with swagger
Scaling with swaggerScaling with swagger
Scaling with swagger
Tony Tam
 
ITB2017 - Slaying the ORM dragons with cborm
ITB2017 - Slaying the ORM dragons with cbormITB2017 - Slaying the ORM dragons with cborm
ITB2017 - Slaying the ORM dragons with cborm
Ortus Solutions, Corp
 
Why ruby and rails
Why ruby and railsWhy ruby and rails
Why ruby and rails
Reuven Lerner
 
Stack Exchange Infrastructure - LISA 14
Stack Exchange Infrastructure - LISA 14Stack Exchange Infrastructure - LISA 14
Stack Exchange Infrastructure - LISA 14
GABeech
 
ORM Methodology
ORM MethodologyORM Methodology
ORM Methodology
Ahmed Gomaa
 
Hibernate
HibernateHibernate
Hibernate
Sujit Kumar
 
Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3
Wen-Tien Chang
 
Why we love ArangoDB. The hunt for the right NosQL Database
Why we love ArangoDB. The hunt for the right NosQL DatabaseWhy we love ArangoDB. The hunt for the right NosQL Database
Why we love ArangoDB. The hunt for the right NosQL Database
Andreas Jung
 
Scalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsScalability, Availability & Stability Patterns
Scalability, Availability & Stability Patterns
Jonas Bonér
 
JSR 335 / java 8 - update reference
JSR 335 / java 8 - update referenceJSR 335 / java 8 - update reference
JSR 335 / java 8 - update reference
sandeepji_choudhary
 
SeaJUG May 2012 mybatis
SeaJUG May 2012 mybatisSeaJUG May 2012 mybatis
SeaJUG May 2012 mybatis
Will Iverson
 
What is persistence in java
What is persistence in javaWhat is persistence in java
What is persistence in java
Benjamin Kim
 
MongoDC 2012: "Operationalizing" MongoDB@AOL
MongoDC 2012: "Operationalizing" MongoDB@AOLMongoDC 2012: "Operationalizing" MongoDB@AOL
MongoDC 2012: "Operationalizing" MongoDB@AOL
MongoDB
 
Operationalizing MongoDB at AOL
Operationalizing MongoDB at AOLOperationalizing MongoDB at AOL
Operationalizing MongoDB at AOL
radiocats
 
New Persistence Features in Spring Roo 1.1
New Persistence Features in Spring Roo 1.1New Persistence Features in Spring Roo 1.1
New Persistence Features in Spring Roo 1.1
Stefan Schmidt
 
What-is-Laravel and introduciton to Laravel
What-is-Laravel and introduciton to LaravelWhat-is-Laravel and introduciton to Laravel
What-is-Laravel and introduciton to Laravel
PraveenHegde20
 
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
BIWUG
 
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
 
hibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdfhibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdf
Patiento Del Mar
 
Introduction to Object-Relational Mapping
Introduction to Object-Relational MappingIntroduction to Object-Relational Mapping
Introduction to Object-Relational Mapping
Ali Shakiba
 
Scaling with swagger
Scaling with swaggerScaling with swagger
Scaling with swagger
Tony Tam
 
ITB2017 - Slaying the ORM dragons with cborm
ITB2017 - Slaying the ORM dragons with cbormITB2017 - Slaying the ORM dragons with cborm
ITB2017 - Slaying the ORM dragons with cborm
Ortus Solutions, Corp
 
Stack Exchange Infrastructure - LISA 14
Stack Exchange Infrastructure - LISA 14Stack Exchange Infrastructure - LISA 14
Stack Exchange Infrastructure - LISA 14
GABeech
 
Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3
Wen-Tien Chang
 
Why we love ArangoDB. The hunt for the right NosQL Database
Why we love ArangoDB. The hunt for the right NosQL DatabaseWhy we love ArangoDB. The hunt for the right NosQL Database
Why we love ArangoDB. The hunt for the right NosQL Database
Andreas Jung
 
Scalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsScalability, Availability & Stability Patterns
Scalability, Availability & Stability Patterns
Jonas Bonér
 
JSR 335 / java 8 - update reference
JSR 335 / java 8 - update referenceJSR 335 / java 8 - update reference
JSR 335 / java 8 - update reference
sandeepji_choudhary
 
SeaJUG May 2012 mybatis
SeaJUG May 2012 mybatisSeaJUG May 2012 mybatis
SeaJUG May 2012 mybatis
Will Iverson
 
What is persistence in java
What is persistence in javaWhat is persistence in java
What is persistence in java
Benjamin Kim
 
MongoDC 2012: "Operationalizing" MongoDB@AOL
MongoDC 2012: "Operationalizing" MongoDB@AOLMongoDC 2012: "Operationalizing" MongoDB@AOL
MongoDC 2012: "Operationalizing" MongoDB@AOL
MongoDB
 
Operationalizing MongoDB at AOL
Operationalizing MongoDB at AOLOperationalizing MongoDB at AOL
Operationalizing MongoDB at AOL
radiocats
 
New Persistence Features in Spring Roo 1.1
New Persistence Features in Spring Roo 1.1New Persistence Features in Spring Roo 1.1
New Persistence Features in Spring Roo 1.1
Stefan Schmidt
 
What-is-Laravel and introduciton to Laravel
What-is-Laravel and introduciton to LaravelWhat-is-Laravel and introduciton to Laravel
What-is-Laravel and introduciton to Laravel
PraveenHegde20
 
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
BIWUG
 
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
 

Recently uploaded (20)

Driving Transportation Forward: Real-World Data Solutions
Driving Transportation Forward: Real-World Data SolutionsDriving Transportation Forward: Real-World Data Solutions
Driving Transportation Forward: Real-World Data Solutions
Safe Software
 
oil seed milling- extraction and Refining
oil seed milling- extraction and Refiningoil seed milling- extraction and Refining
oil seed milling- extraction and Refining
MaheshKadam154653
 
The Gold Jacket Journey - How I passed 12 AWS Certs without Burning Out (and ...
The Gold Jacket Journey - How I passed 12 AWS Certs without Burning Out (and ...The Gold Jacket Journey - How I passed 12 AWS Certs without Burning Out (and ...
The Gold Jacket Journey - How I passed 12 AWS Certs without Burning Out (and ...
VictorSzoltysek
 
Top 5+ Soulmate AI chatbots Platform for 2025
Top 5+ Soulmate AI chatbots Platform for 2025Top 5+ Soulmate AI chatbots Platform for 2025
Top 5+ Soulmate AI chatbots Platform for 2025
Soulmaite
 
Leading a High-Stakes Database Migration
Leading a High-Stakes Database MigrationLeading a High-Stakes Database Migration
Leading a High-Stakes Database Migration
ScyllaDB
 
A Guide to Smart Building Open Standards 101
A Guide to Smart Building Open Standards 101A Guide to Smart Building Open Standards 101
A Guide to Smart Building Open Standards 101
Memoori
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
BrainSell Technologies
 
Transforming Technical Debt to Technical Wealth in Your Salesforce Org
Transforming Technical Debt to Technical Wealth in Your Salesforce OrgTransforming Technical Debt to Technical Wealth in Your Salesforce Org
Transforming Technical Debt to Technical Wealth in Your Salesforce Org
Lynda Kane
 
What comes after world domination with Daniel Stenberg, April 2025
What comes after world domination with Daniel Stenberg, April 2025What comes after world domination with Daniel Stenberg, April 2025
What comes after world domination with Daniel Stenberg, April 2025
Daniel Stenberg
 
Towards value-awareness in administrative processes: an approach based on con...
Towards value-awareness in administrative processes: an approach based on con...Towards value-awareness in administrative processes: an approach based on con...
Towards value-awareness in administrative processes: an approach based on con...
Universidad Rey Juan Carlos
 
EIS-Manufacturing-AI–Product-Data-Optimization-Webinar-2025.pptx
EIS-Manufacturing-AI–Product-Data-Optimization-Webinar-2025.pptxEIS-Manufacturing-AI–Product-Data-Optimization-Webinar-2025.pptx
EIS-Manufacturing-AI–Product-Data-Optimization-Webinar-2025.pptx
Earley Information Science
 
Introduction to LLM Post-Training - MIT 6.S191 2025
Introduction to LLM Post-Training - MIT 6.S191 2025Introduction to LLM Post-Training - MIT 6.S191 2025
Introduction to LLM Post-Training - MIT 6.S191 2025
Maxime Labonne
 
Autopilot for Everyone Series - Session 3: Exploring Real-World Use Cases
Autopilot for Everyone Series - Session 3: Exploring Real-World Use CasesAutopilot for Everyone Series - Session 3: Exploring Real-World Use Cases
Autopilot for Everyone Series - Session 3: Exploring Real-World Use Cases
UiPathCommunity
 
UiPath Automation Developer Associate 2025 Series - Career Office Hours
UiPath Automation Developer Associate 2025 Series - Career Office HoursUiPath Automation Developer Associate 2025 Series - Career Office Hours
UiPath Automation Developer Associate 2025 Series - Career Office Hours
DianaGray10
 
UiPath Community - AI Center and LLM.pdf
UiPath Community - AI Center and LLM.pdfUiPath Community - AI Center and LLM.pdf
UiPath Community - AI Center and LLM.pdf
UiPathCommunity
 
Meme Coin Development The Roadmap from Concept to Triumph.pdf
Meme Coin Development The Roadmap from Concept to Triumph.pdfMeme Coin Development The Roadmap from Concept to Triumph.pdf
Meme Coin Development The Roadmap from Concept to Triumph.pdf
Abi john
 
Feichun_AS_NZS_1802_AS_NZS_2802_Mining_Cable_Catalogue.pdf
Feichun_AS_NZS_1802_AS_NZS_2802_Mining_Cable_Catalogue.pdfFeichun_AS_NZS_1802_AS_NZS_2802_Mining_Cable_Catalogue.pdf
Feichun_AS_NZS_1802_AS_NZS_2802_Mining_Cable_Catalogue.pdf
Anhui Feichun Special Cable Co., Ltd.
 
Leveraging AI and Agentforce for Intelligent Automation in the Salesforce & M...
Leveraging AI and Agentforce for Intelligent Automation in the Salesforce & M...Leveraging AI and Agentforce for Intelligent Automation in the Salesforce & M...
Leveraging AI and Agentforce for Intelligent Automation in the Salesforce & M...
shyamraj55
 
Teach the importance of logic (programming)in Computer Science and why it is ...
Teach the importance of logic (programming)in Computer Science and why it is ...Teach the importance of logic (programming)in Computer Science and why it is ...
Teach the importance of logic (programming)in Computer Science and why it is ...
Universidad Rey Juan Carlos
 
Beginners: Radio Frequency, Band and Spectrum (V3)
Beginners: Radio Frequency, Band and Spectrum (V3)Beginners: Radio Frequency, Band and Spectrum (V3)
Beginners: Radio Frequency, Band and Spectrum (V3)
3G4G
 
Driving Transportation Forward: Real-World Data Solutions
Driving Transportation Forward: Real-World Data SolutionsDriving Transportation Forward: Real-World Data Solutions
Driving Transportation Forward: Real-World Data Solutions
Safe Software
 
oil seed milling- extraction and Refining
oil seed milling- extraction and Refiningoil seed milling- extraction and Refining
oil seed milling- extraction and Refining
MaheshKadam154653
 
The Gold Jacket Journey - How I passed 12 AWS Certs without Burning Out (and ...
The Gold Jacket Journey - How I passed 12 AWS Certs without Burning Out (and ...The Gold Jacket Journey - How I passed 12 AWS Certs without Burning Out (and ...
The Gold Jacket Journey - How I passed 12 AWS Certs without Burning Out (and ...
VictorSzoltysek
 
Top 5+ Soulmate AI chatbots Platform for 2025
Top 5+ Soulmate AI chatbots Platform for 2025Top 5+ Soulmate AI chatbots Platform for 2025
Top 5+ Soulmate AI chatbots Platform for 2025
Soulmaite
 
Leading a High-Stakes Database Migration
Leading a High-Stakes Database MigrationLeading a High-Stakes Database Migration
Leading a High-Stakes Database Migration
ScyllaDB
 
A Guide to Smart Building Open Standards 101
A Guide to Smart Building Open Standards 101A Guide to Smart Building Open Standards 101
A Guide to Smart Building Open Standards 101
Memoori
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
BrainSell Technologies
 
Transforming Technical Debt to Technical Wealth in Your Salesforce Org
Transforming Technical Debt to Technical Wealth in Your Salesforce OrgTransforming Technical Debt to Technical Wealth in Your Salesforce Org
Transforming Technical Debt to Technical Wealth in Your Salesforce Org
Lynda Kane
 
What comes after world domination with Daniel Stenberg, April 2025
What comes after world domination with Daniel Stenberg, April 2025What comes after world domination with Daniel Stenberg, April 2025
What comes after world domination with Daniel Stenberg, April 2025
Daniel Stenberg
 
Towards value-awareness in administrative processes: an approach based on con...
Towards value-awareness in administrative processes: an approach based on con...Towards value-awareness in administrative processes: an approach based on con...
Towards value-awareness in administrative processes: an approach based on con...
Universidad Rey Juan Carlos
 
EIS-Manufacturing-AI–Product-Data-Optimization-Webinar-2025.pptx
EIS-Manufacturing-AI–Product-Data-Optimization-Webinar-2025.pptxEIS-Manufacturing-AI–Product-Data-Optimization-Webinar-2025.pptx
EIS-Manufacturing-AI–Product-Data-Optimization-Webinar-2025.pptx
Earley Information Science
 
Introduction to LLM Post-Training - MIT 6.S191 2025
Introduction to LLM Post-Training - MIT 6.S191 2025Introduction to LLM Post-Training - MIT 6.S191 2025
Introduction to LLM Post-Training - MIT 6.S191 2025
Maxime Labonne
 
Autopilot for Everyone Series - Session 3: Exploring Real-World Use Cases
Autopilot for Everyone Series - Session 3: Exploring Real-World Use CasesAutopilot for Everyone Series - Session 3: Exploring Real-World Use Cases
Autopilot for Everyone Series - Session 3: Exploring Real-World Use Cases
UiPathCommunity
 
UiPath Automation Developer Associate 2025 Series - Career Office Hours
UiPath Automation Developer Associate 2025 Series - Career Office HoursUiPath Automation Developer Associate 2025 Series - Career Office Hours
UiPath Automation Developer Associate 2025 Series - Career Office Hours
DianaGray10
 
UiPath Community - AI Center and LLM.pdf
UiPath Community - AI Center and LLM.pdfUiPath Community - AI Center and LLM.pdf
UiPath Community - AI Center and LLM.pdf
UiPathCommunity
 
Meme Coin Development The Roadmap from Concept to Triumph.pdf
Meme Coin Development The Roadmap from Concept to Triumph.pdfMeme Coin Development The Roadmap from Concept to Triumph.pdf
Meme Coin Development The Roadmap from Concept to Triumph.pdf
Abi john
 
Leveraging AI and Agentforce for Intelligent Automation in the Salesforce & M...
Leveraging AI and Agentforce for Intelligent Automation in the Salesforce & M...Leveraging AI and Agentforce for Intelligent Automation in the Salesforce & M...
Leveraging AI and Agentforce for Intelligent Automation in the Salesforce & M...
shyamraj55
 
Teach the importance of logic (programming)in Computer Science and why it is ...
Teach the importance of logic (programming)in Computer Science and why it is ...Teach the importance of logic (programming)in Computer Science and why it is ...
Teach the importance of logic (programming)in Computer Science and why it is ...
Universidad Rey Juan Carlos
 
Beginners: Radio Frequency, Band and Spectrum (V3)
Beginners: Radio Frequency, Band and Spectrum (V3)Beginners: Radio Frequency, Band and Spectrum (V3)
Beginners: Radio Frequency, Band and Spectrum (V3)
3G4G
 

ORM, JPA, & Hibernate Overview

  • 1. Hibernate ORM & JPA Overview Brett Meyer Senior Software Engineer Hibernate ORM, Red Hat
  • 2. Brett Meyer • JBoss Overlord (SOA Governance) • Hibernate ORM – ORM 4 & 5 development – Hibernate OSGi – Developer community engagement – Red Hat support, Hibernate engineering lead • Other contributions – Apache Camel – Infinispan • Contact me – @brettemeyer or +brettmeyer – Freenode IRC: brmeyer
  • 4. ORM? JPA? • ORM: Object/Relational Mapping • JPA: Java Persistence API • Hibernate ORM provides its own native API, in addition to full JPA support • Annotations and XML
  • 5. Overview • JDBC • Why ORM? • Why JPA? • Hibernate ORM • Demos
  • 7. JDBC • “Java Database Connectivity” • Java SE library for querying/updating database data • Mainly focused on relational DBs • Manages Connections to the DB, either directly or through a 3rd party “Connection Pool” • Database vendors provide their own JDBC driver libraries
  • 8. JDBC (cont'd) • API abstracts common interactions, data types, etc. • Execute SQL through “Statements” • Query returns received through “ResultSets” • Transactional • Cacheable
  • 11. ORM • “Object/Relational Mapping” • “Persistence”: Data objects outlive the JVM app • Maps Java POJOs to relational databases (one type of “persistence”)
  • 12. Why ORM? • “Domain Model” pattern – Focus on business concepts, not relational DB structure – Interconnected objects – Each object is a meaningful individual/concept – OO concepts: inheritance, object identity, etc. – Navigate data by walking the object graph, not the explicit relational model
  • 13. Why ORM? (cont'd) • Increased development speed & reduced code – No “by-hand” mapping of JDBC ResultSets to POJOs – Less work synchronizing code with relational DB changes – Less JBDC boilerplate (repetitious CRUD) – Focus on business logic
  • 14. Why ORM? (cont'd) • Portability – Mostly DB independent (exception: some types of features, identifier generation, etc.) – Query abstractions (OO APIs, OO- structured languages, etc.) – Vendor-specific SQL is auto generated
  • 15. Why ORM? (cont'd) • Performance – Granular control of “when”, “how”, “how much” data/relationships to load, based on the business logic – Object and query caching • Concurrency & multiple-tenancy • Transactional • Scalable • Extendable (many types of extension points)
  • 16. ORM FUD • “ORMs are slow and generally awful.” – http://www.slideshare.net/brmeyer/hibernate-orm • “ORMs are over complicated.” – Back in the EJB/XML days, maybe. – Annotations FTW!
  • 19. JPA • “Java Persistence API” • JSR 317 (2.0) & JSR 338 (2.1) • Included in both Java SE & Java EE • Provides portability between JPA implementations (with caveats) • Same ORM concepts, but standardized API and query language (JPQL)
  • 22. Hibernate ORM • JPA implementation and 100% TCK compliant • “Native” features – HQL (Hibernate Query Language): similar to JPQL, but extended – Criteria API – Performance: Fetch strategies, caching, bytecode enhancement, etc. – Extension points – Rich tool set (schema generation/validation, etc.) • Part of JBoss Community
  • 23. Hibernate Family • Not just ORM • Hibernate Spatial • Hibernate Envers • Hibernate OSGi • Hibernate Search • Hibernate OGM • Hibernate Validator • Hibernate Shards • http://www.slideshare.net/brmeyer/hibernate-orm-features
  • 26. QUESTIONS? • Q&A • Freenode IRC: brmeyer • @brettemeyer • +brettmeyer