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)

PDF
Spring Framework - Core
Dzmitry Naskou
 
DOC
Hibernate tutorial for beginners
Rahul Jain
 
PPTX
Java Spring
AathikaJava
 
PDF
JPA and Hibernate
elliando dias
 
PDF
2022-06-23 Apache Arrow and DataFusion_ Changing the Game for implementing Da...
Andrew Lamb
 
PPTX
Intro to React
Justin Reock
 
PDF
Spring Boot
Jaran Flaath
 
PPT
Spring Core
Pushan Bhattacharya
 
PPSX
Spring - Part 1 - IoC, Di and Beans
Hitesh-Java
 
PDF
Intro to Asynchronous Javascript
Garrett Welson
 
PPTX
Java Micro-Benchmarking
Constantine Nosovsky
 
PDF
React&redux
Blank Chen
 
PDF
Api presentation
Tiago Cardoso
 
PPTX
Laravel introduction
Simon Funk
 
PDF
From Java 11 to 17 and beyond.pdf
José Paumard
 
PPTX
JPA For Beginner's
NarayanaMurthy Ganashree
 
PPTX
Spring Boot
Jiayun Zhou
 
PDF
REST API and CRUD
Prem Sanil
 
PPT
Hibernate Tutorial
Ram132
 
Spring Framework - Core
Dzmitry Naskou
 
Hibernate tutorial for beginners
Rahul Jain
 
Java Spring
AathikaJava
 
JPA and Hibernate
elliando dias
 
2022-06-23 Apache Arrow and DataFusion_ Changing the Game for implementing Da...
Andrew Lamb
 
Intro to React
Justin Reock
 
Spring Boot
Jaran Flaath
 
Spring Core
Pushan Bhattacharya
 
Spring - Part 1 - IoC, Di and Beans
Hitesh-Java
 
Intro to Asynchronous Javascript
Garrett Welson
 
Java Micro-Benchmarking
Constantine Nosovsky
 
React&redux
Blank Chen
 
Api presentation
Tiago Cardoso
 
Laravel introduction
Simon Funk
 
From Java 11 to 17 and beyond.pdf
José Paumard
 
JPA For Beginner's
NarayanaMurthy Ganashree
 
Spring Boot
Jiayun Zhou
 
REST API and CRUD
Prem Sanil
 
Hibernate Tutorial
Ram132
 

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

PDF
Orm loveandhate
Wil de Bruin
 
PPT
Dao benchmark
Mallikarjuna G D
 
PDF
Free Hibernate Tutorial | VirtualNuggets
Virtual Nuggets
 
PPTX
Hibernate ORM over JDBC
Pratyush Katre
 
PDF
ITB2017 - Slaying the ORM dragons with cborm
Ortus Solutions, Corp
 
PPT
Hibernate
Ajay K
 
PPTX
Hibernate_ORM_JPA Hibernate_ORM_JPA.pptx
dntech9x
 
PPTX
Hibernate in Action
Akshay Ballarpure
 
PPTX
What is Hibernate Framework?
Ducat India
 
PPTX
Advance java session 5
Smita B Kumar
 
PPT
585287jjkkklllllllll iiijilhffgjjjhjjjhgfghj
JuJU789934
 
PDF
Evolution of database access technologies in Java-based software projects
Tom Mens
 
PPTX
Module-3 for career and JFSD ppt for study.pptx
ViratKohli78
 
PPT
Introduction to Object-Relational Mapping
Ali Shakiba
 
PPT
Hibernate
husnara mohammad
 
PPT
Hibernate introduction
husnara mohammad
 
PPT
jpa-hibernate-presentation
John Slick
 
PDF
Killing Shark-Riding Dinosaurs with ORM
Ortus Solutions, Corp
 
PPTX
The tortoise and the ORM
Frikkie van Biljon
 
PDF
2024 DAPUG Conference Arnaud Bouchez ORM ODM and mORMot
Arnaud Bouchez
 
Orm loveandhate
Wil de Bruin
 
Dao benchmark
Mallikarjuna G D
 
Free Hibernate Tutorial | VirtualNuggets
Virtual Nuggets
 
Hibernate ORM over JDBC
Pratyush Katre
 
ITB2017 - Slaying the ORM dragons with cborm
Ortus Solutions, Corp
 
Hibernate
Ajay K
 
Hibernate_ORM_JPA Hibernate_ORM_JPA.pptx
dntech9x
 
Hibernate in Action
Akshay Ballarpure
 
What is Hibernate Framework?
Ducat India
 
Advance java session 5
Smita B Kumar
 
585287jjkkklllllllll iiijilhffgjjjhjjjhgfghj
JuJU789934
 
Evolution of database access technologies in Java-based software projects
Tom Mens
 
Module-3 for career and JFSD ppt for study.pptx
ViratKohli78
 
Introduction to Object-Relational Mapping
Ali Shakiba
 
Hibernate
husnara mohammad
 
Hibernate introduction
husnara mohammad
 
jpa-hibernate-presentation
John Slick
 
Killing Shark-Riding Dinosaurs with ORM
Ortus Solutions, Corp
 
The tortoise and the ORM
Frikkie van Biljon
 
2024 DAPUG Conference Arnaud Bouchez ORM ODM and mORMot
Arnaud Bouchez
 
Ad

Recently uploaded (20)

PDF
NASA A Researcher’s Guide to International Space Station : Fundamental Physics
Dr. PANKAJ DHUSSA
 
PDF
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
PDF
Next Generation AI: Anticipatory Intelligence, Forecasting Inflection Points ...
dleka294658677
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
PDF
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pdf
ghjghvhjgc
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
“ONNX and Python to C++: State-of-the-art Graph Compilation,” a Presentation ...
Edge AI and Vision Alliance
 
PDF
NASA A Researcher’s Guide to International Space Station : Earth Observations
Dr. PANKAJ DHUSSA
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PPTX
Role_of_Artificial_Intelligence_in_Livestock_Extension_Services.pptx
DrRajdeepMadavi
 
PPTX
Manual Testing for Accessibility Enhancement
Julia Undeutsch
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PPTX
CapCut Pro PC Crack Latest Version Free Free
josanj305
 
PPTX
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
Hitachi, Ltd. OSS Solution Center.
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
PDF
Survival Models: Proper Scoring Rule and Stochastic Optimization with Competi...
Paris Women in Machine Learning and Data Science
 
NASA A Researcher’s Guide to International Space Station : Fundamental Physics
Dr. PANKAJ DHUSSA
 
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
Next Generation AI: Anticipatory Intelligence, Forecasting Inflection Points ...
dleka294658677
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pdf
ghjghvhjgc
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
“ONNX and Python to C++: State-of-the-art Graph Compilation,” a Presentation ...
Edge AI and Vision Alliance
 
NASA A Researcher’s Guide to International Space Station : Earth Observations
Dr. PANKAJ DHUSSA
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Role_of_Artificial_Intelligence_in_Livestock_Extension_Services.pptx
DrRajdeepMadavi
 
Manual Testing for Accessibility Enhancement
Julia Undeutsch
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
CapCut Pro PC Crack Latest Version Free Free
josanj305
 
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
Hitachi, Ltd. OSS Solution Center.
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
Survival Models: Proper Scoring Rule and Stochastic Optimization with Competi...
Paris Women in Machine Learning and Data Science
 
Ad

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