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

PDF
Hibernate ORM: Tips, Tricks, and Performance Techniques
PDF
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
PDF
High-Performance Hibernate Devoxx France 2016
PDF
JPA and Hibernate
PDF
Secrets of Performance Tuning Java on Kubernetes
PPTX
From cache to in-memory data grid. Introduction to Hazelcast.
PPSX
Spring - Part 1 - IoC, Di and Beans
PDF
Spring Boot
Hibernate ORM: Tips, Tricks, and Performance Techniques
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
High-Performance Hibernate Devoxx France 2016
JPA and Hibernate
Secrets of Performance Tuning Java on Kubernetes
From cache to in-memory data grid. Introduction to Hazelcast.
Spring - Part 1 - IoC, Di and Beans
Spring Boot

What's hot (20)

PPT
Spring Core
PDF
인프콘 2022 - Rust 크로스 플랫폼 프로그래밍
PDF
Spring boot introduction
PDF
ORM: Object-relational mapping
PPTX
Unique ID generation in distributed systems
PDF
Ksug2015 - JPA3, JPA 내부구조
PPTX
Hibernate ppt
PPT
Hibernate
PDF
SPA Editor - Adobe Experience Manager Sites
PDF
Beyond Java: 자바 8을 중심으로 본 자바의 혁신
PDF
How to build massive service for advance
PDF
Apache Jackrabbit Oak - Scale your content repository to the cloud
PDF
Spring Boot
DOC
Java Servlets & JSP
PDF
Spring Boot
PDF
[Outdated] Secrets of Performance Tuning Java on Kubernetes
PDF
Learn REST in 18 Slides
PDF
MongoDB and Node.js
PPTX
Introduction to Spring Boot
PDF
REST API Best (Recommended) Practices
Spring Core
인프콘 2022 - Rust 크로스 플랫폼 프로그래밍
Spring boot introduction
ORM: Object-relational mapping
Unique ID generation in distributed systems
Ksug2015 - JPA3, JPA 내부구조
Hibernate ppt
Hibernate
SPA Editor - Adobe Experience Manager Sites
Beyond Java: 자바 8을 중심으로 본 자바의 혁신
How to build massive service for advance
Apache Jackrabbit Oak - Scale your content repository to the cloud
Spring Boot
Java Servlets & JSP
Spring Boot
[Outdated] Secrets of Performance Tuning Java on Kubernetes
Learn REST in 18 Slides
MongoDB and Node.js
Introduction to Spring Boot
REST API Best (Recommended) Practices
Ad

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

PPT
Introduction to Object-Relational Mapping
PPTX
Scaling with swagger
PDF
ITB2017 - Slaying the ORM dragons with cborm
KEY
Why ruby and rails
PPTX
Stack Exchange Infrastructure - LISA 14
PPTX
ORM Methodology
PPTX
Hibernate
PDF
Service-Oriented Design and Implement with Rails3
PDF
Why we love ArangoDB. The hunt for the right NosQL Database
PDF
Scalability, Availability & Stability Patterns
PDF
JSR 335 / java 8 - update reference
PPTX
SeaJUG May 2012 mybatis
PPTX
What is persistence in java
PPTX
Operationalizing MongoDB at AOL
PPTX
MongoDC 2012: "Operationalizing" MongoDB@AOL
PDF
New Persistence Features in Spring Roo 1.1
PPTX
What-is-Laravel and introduciton to Laravel
PPTX
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
PDF
CQRS and Event Sourcing for Java Developers
PPTX
Why databases cry at night
Introduction to Object-Relational Mapping
Scaling with swagger
ITB2017 - Slaying the ORM dragons with cborm
Why ruby and rails
Stack Exchange Infrastructure - LISA 14
ORM Methodology
Hibernate
Service-Oriented Design and Implement with Rails3
Why we love ArangoDB. The hunt for the right NosQL Database
Scalability, Availability & Stability Patterns
JSR 335 / java 8 - update reference
SeaJUG May 2012 mybatis
What is persistence in java
Operationalizing MongoDB at AOL
MongoDC 2012: "Operationalizing" MongoDB@AOL
New Persistence Features in Spring Roo 1.1
What-is-Laravel and introduciton to Laravel
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
CQRS and Event Sourcing for Java Developers
Why databases cry at night
Ad

Recently uploaded (20)

PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
KodekX | Application Modernization Development
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
cuic standard and advanced reporting.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Electronic commerce courselecture one. Pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Big Data Technologies - Introduction.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
KodekX | Application Modernization Development
20250228 LYD VKU AI Blended-Learning.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Building Integrated photovoltaic BIPV_UPV.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
cuic standard and advanced reporting.pdf
Encapsulation theory and applications.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
The AUB Centre for AI in Media Proposal.docx
Electronic commerce courselecture one. Pdf
Programs and apps: productivity, graphics, security and other tools
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Network Security Unit 5.pdf for BCA BBA.
Reach Out and Touch Someone: Haptics and Empathic Computing
Diabetes mellitus diagnosis method based random forest with bat algorithm
Big Data Technologies - Introduction.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?

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