[フレーム]
ODP, PDF71,721 views

ORM, JPA, & Hibernate Overview

Brett Meyer gave an overview of Hibernate ORM and JPA. He discussed that ORM maps Java objects to relational databases for persistence beyond the life of a program. JPA is the Java standard for ORM that provides portability, while Hibernate is a full-featured JPA implementation with additional native features. Hibernate allows focusing on business logic rather than data access details and provides performance, concurrency, and extensibility benefits over traditional JDBC usage.

Downloaded 1,178 times
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

Spring - Part 1 - IoC, Di and Beans
PPSX
Spring - Part 1 - IoC, Di and Beans
Spring Framework - AOP
PDF
Spring Framework - AOP
Spring JDBCTemplate
PPTX
Spring JDBCTemplate
Spring boot
PPTX
Spring boot
Spring Framework
PPT
Spring Framework
Java Hibernate Programming with Architecture Diagram and Example
PPS
Java Hibernate Programming with Architecture Diagram and Example
Introduction to Spring Framework
PDF
Introduction to Spring Framework
Spring Framework - Core
PDF
Spring Framework - Core
Spring - Part 1 - IoC, Di and Beans
Spring - Part 1 - IoC, Di and Beans
Spring Framework - AOP
Spring Framework - AOP
Spring JDBCTemplate
Spring JDBCTemplate
Spring boot
Spring boot
Spring Framework
Spring Framework
Java Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and Example
Introduction to Spring Framework
Introduction to Spring Framework
Spring Framework - Core
Spring Framework - Core

What's hot

Spring Data JPA from 0-100 in 60 minutes
PDF
Spring Data JPA from 0-100 in 60 minutes
Introduction to JPA and Hibernate including examples
PDF
Introduction to JPA and Hibernate including examples
Spring Boot
PPTX
Spring Boot
Node.js Express Framework
PPT
Node.js Express Framework
Spring Core
PPT
Spring Core
MongoDB
PPTX
MongoDB
Spring framework IOC and Dependency Injection
PPTX
Spring framework IOC and Dependency Injection
Spring MVC
PDF
Spring MVC
Spring Data JPA
PDF
Spring Data JPA
Maven 3 Overview
PDF
Maven 3 Overview
Spring boot jpa
PDF
Spring boot jpa
Introduction to Spring's Dependency Injection
PDF
Introduction to Spring's Dependency Injection
Spring Boot and REST API
PPTX
Spring Boot and REST API
Introduction to spring boot
PPTX
Introduction to spring boot
REST API Design & Development
PPTX
REST API Design & Development
Spring Boot
PDF
Spring Boot
Introduction to RxJS
PDF
Introduction to RxJS
jpa-hibernate-presentation
PPT
jpa-hibernate-presentation
Spring & hibernate
PPTX
Spring & hibernate
Spring data jpa
PPTX
Spring data jpa
Spring Data JPA from 0-100 in 60 minutes
Spring Data JPA from 0-100 in 60 minutes
Introduction to JPA and Hibernate including examples
Introduction to JPA and Hibernate including examples
Spring Boot
Spring Boot
Node.js Express Framework
Node.js Express Framework
Spring Core
Spring Core
MongoDB
MongoDB
Spring framework IOC and Dependency Injection
Spring framework IOC and Dependency Injection
Spring MVC
Spring MVC
Spring Data JPA
Spring Data JPA
Maven 3 Overview
Maven 3 Overview
Spring boot jpa
Spring boot jpa
Introduction to Spring's Dependency Injection
Introduction to Spring's Dependency Injection
Spring Boot and REST API
Spring Boot and REST API
Introduction to spring boot
Introduction to spring boot
REST API Design & Development
REST API Design & Development
Spring Boot
Spring Boot
Introduction to RxJS
Introduction to RxJS
jpa-hibernate-presentation
jpa-hibernate-presentation
Spring & hibernate
Spring & hibernate
Spring data jpa
Spring data jpa

Similar to ORM, JPA, & Hibernate Overview

Orm loveandhate
PDF
Orm loveandhate
Dao benchmark
PPT
Dao benchmark
Free Hibernate Tutorial | VirtualNuggets
PDF
Free Hibernate Tutorial | VirtualNuggets
Hibernate ORM over JDBC
PPTX
Hibernate ORM over JDBC
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
PDF
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
ITB2017 - Slaying the ORM dragons with cborm
PDF
ITB2017 - Slaying the ORM dragons with cborm
Hibernate
PPT
Hibernate
Hibernate_ORM_JPA Hibernate_ORM_JPA.pptx
PPTX
Hibernate_ORM_JPA Hibernate_ORM_JPA.pptx
Hibernate in Action
PPTX
Hibernate in Action
What is Hibernate Framework?
PPTX
What is Hibernate Framework?
Advance java session 5
PPTX
Advance java session 5
585287jjkkklllllllll iiijilhffgjjjhjjjhgfghj
PPT
585287jjkkklllllllll iiijilhffgjjjhjjjhgfghj
Evolution of database access technologies in Java-based software projects
PDF
Evolution of database access technologies in Java-based software projects
Module-3 for career and JFSD ppt for study.pptx
PPTX
Module-3 for career and JFSD ppt for study.pptx
Introduction to Object-Relational Mapping
PPT
Introduction to Object-Relational Mapping
Hibernate introduction
PPT
Hibernate introduction
Hibernate
PPT
Hibernate
Killing Shark-Riding Dinosaurs with ORM
PDF
Killing Shark-Riding Dinosaurs with ORM
What Is an ORM and How Does It Work? | Hyperlink InfoSystem
PPTX
What Is an ORM and How Does It Work? | Hyperlink InfoSystem
The tortoise and the ORM
PPTX
The tortoise and the ORM
Orm loveandhate
Orm loveandhate
Dao benchmark
Dao benchmark
Free Hibernate Tutorial | VirtualNuggets
Free Hibernate Tutorial | VirtualNuggets
Hibernate ORM over JDBC
Hibernate ORM over JDBC
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
ITB2017 - Slaying the ORM dragons with cborm
ITB2017 - Slaying the ORM dragons with cborm
Hibernate
Hibernate
Hibernate_ORM_JPA Hibernate_ORM_JPA.pptx
Hibernate_ORM_JPA Hibernate_ORM_JPA.pptx
Hibernate in Action
Hibernate in Action
What is Hibernate Framework?
What is Hibernate Framework?
Advance java session 5
Advance java session 5
585287jjkkklllllllll iiijilhffgjjjhjjjhgfghj
585287jjkkklllllllll iiijilhffgjjjhjjjhgfghj
Evolution of database access technologies in Java-based software projects
Evolution of database access technologies in Java-based software projects
Module-3 for career and JFSD ppt for study.pptx
Module-3 for career and JFSD ppt for study.pptx
Introduction to Object-Relational Mapping
Introduction to Object-Relational Mapping
Hibernate introduction
Hibernate introduction
Hibernate
Hibernate
Killing Shark-Riding Dinosaurs with ORM
Killing Shark-Riding Dinosaurs with ORM
What Is an ORM and How Does It Work? | Hyperlink InfoSystem
What Is an ORM and How Does It Work? | Hyperlink InfoSystem
The tortoise and the ORM
The tortoise and the ORM

Recently uploaded

Google Cloud Quest : An introductory training session on how to solve Google ...
PPTX
Google Cloud Quest : An introductory training session on how to solve Google ...
Manage VMs on Kubernetes - Introduction to KubeVirt - Meetup MUC 10.2025
PDF
Manage VMs on Kubernetes - Introduction to KubeVirt - Meetup MUC 10.2025
WUG-DMV: Workfront Wizards: Tips & Tricks Exchange (Sept 2025)
PPTX
WUG-DMV: Workfront Wizards: Tips & Tricks Exchange (Sept 2025)
How computers tell who they are using TPM2.pdf
PDF
How computers tell who they are using TPM2.pdf
Fairness and Bias in AI Ethics and Explainability
PDF
Fairness and Bias in AI Ethics and Explainability
Behind the Scenes at Netflix: Distributed Systems & NoSQL Architecture.
PPTX
Behind the Scenes at Netflix: Distributed Systems & NoSQL Architecture.
Master Deck: GraphSummit Bengaluru (Oct 7)
PDF
Master Deck: GraphSummit Bengaluru (Oct 7)
From Infrastructure to Insight: Technical Pathways to Value in Europe’s Compu...
PDF
From Infrastructure to Insight: Technical Pathways to Value in Europe’s Compu...
Session 4 - Specialized AI Associate Series: UiPath Document Understanding O...
PDF
Session 4 - Specialized AI Associate Series: UiPath Document Understanding O...
A SEA of Energy Efficiency Opportunities!
PDF
A SEA of Energy Efficiency Opportunities!
From Bots to Brains: Getting Started with Agentic Automation in UiPath
PDF
From Bots to Brains: Getting Started with Agentic Automation in UiPath
sap 2016年09月14日_PP_MRPType_VB_Blogged.pptx
PPTX
sap 2016年09月14日_PP_MRPType_VB_Blogged.pptx
CLOUD STUDY JAM 2025 GOOGLE DEVELOPER GROUPS ON CAMPUS NSEC
PPTX
CLOUD STUDY JAM 2025 GOOGLE DEVELOPER GROUPS ON CAMPUS NSEC
Dream Companion Reviews, Pricing, & Alternatives
PDF
Dream Companion Reviews, Pricing, & Alternatives
AI assisted software — Cathedral or Bazaar?.pdf
PDF
AI assisted software — Cathedral or Bazaar?.pdf
Open Source business is of strategic importance to the EUpptx
PPTX
Open Source business is of strategic importance to the EUpptx
Meta and Apple close to settling EU cases.pdf
PDF
Meta and Apple close to settling EU cases.pdf
Artificial Intelligence and YOU - Thinking Thoughtfully about AI
PDF
Artificial Intelligence and YOU - Thinking Thoughtfully about AI
AGV PROTOCOL BRAND KIT COMPLETE VIEW.pdf
PDF
AGV PROTOCOL BRAND KIT COMPLETE VIEW.pdf
TrustArc Webinar - The Future of Third-Party Privacy Risk: Trends, Tactics & ...
PDF
TrustArc Webinar - The Future of Third-Party Privacy Risk: Trends, Tactics & ...
Google Cloud Quest : An introductory training session on how to solve Google ...
Google Cloud Quest : An introductory training session on how to solve Google ...
Manage VMs on Kubernetes - Introduction to KubeVirt - Meetup MUC 10.2025
Manage VMs on Kubernetes - Introduction to KubeVirt - Meetup MUC 10.2025
WUG-DMV: Workfront Wizards: Tips & Tricks Exchange (Sept 2025)
WUG-DMV: Workfront Wizards: Tips & Tricks Exchange (Sept 2025)
How computers tell who they are using TPM2.pdf
How computers tell who they are using TPM2.pdf
Fairness and Bias in AI Ethics and Explainability
Fairness and Bias in AI Ethics and Explainability
Behind the Scenes at Netflix: Distributed Systems & NoSQL Architecture.
Behind the Scenes at Netflix: Distributed Systems & NoSQL Architecture.
Master Deck: GraphSummit Bengaluru (Oct 7)
Master Deck: GraphSummit Bengaluru (Oct 7)
From Infrastructure to Insight: Technical Pathways to Value in Europe’s Compu...
From Infrastructure to Insight: Technical Pathways to Value in Europe’s Compu...
Session 4 - Specialized AI Associate Series: UiPath Document Understanding O...
Session 4 - Specialized AI Associate Series: UiPath Document Understanding O...
A SEA of Energy Efficiency Opportunities!
A SEA of Energy Efficiency Opportunities!
From Bots to Brains: Getting Started with Agentic Automation in UiPath
From Bots to Brains: Getting Started with Agentic Automation in UiPath
sap 2016年09月14日_PP_MRPType_VB_Blogged.pptx
sap 2016年09月14日_PP_MRPType_VB_Blogged.pptx
CLOUD STUDY JAM 2025 GOOGLE DEVELOPER GROUPS ON CAMPUS NSEC
CLOUD STUDY JAM 2025 GOOGLE DEVELOPER GROUPS ON CAMPUS NSEC
Dream Companion Reviews, Pricing, & Alternatives
Dream Companion Reviews, Pricing, & Alternatives
AI assisted software — Cathedral or Bazaar?.pdf
AI assisted software — Cathedral or Bazaar?.pdf
Open Source business is of strategic importance to the EUpptx
Open Source business is of strategic importance to the EUpptx
Meta and Apple close to settling EU cases.pdf
Meta and Apple close to settling EU cases.pdf
Artificial Intelligence and YOU - Thinking Thoughtfully about AI
Artificial Intelligence and YOU - Thinking Thoughtfully about AI
AGV PROTOCOL BRAND KIT COMPLETE VIEW.pdf
AGV PROTOCOL BRAND KIT COMPLETE VIEW.pdf
TrustArc Webinar - The Future of Third-Party Privacy Risk: Trends, Tactics & ...
TrustArc Webinar - The Future of Third-Party Privacy Risk: Trends, Tactics & ...

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
  • 3.
  • 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
  • 6.
  • 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
  • 9.
  • 10.
  • 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!
  • 17.
  • 18.
  • 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)
  • 20.
  • 21.
  • 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
  • 24.
  • 25.
  • 26.
    QUESTIONS? • Q&A • Freenode IRC: brmeyer • @brettemeyer • +brettmeyer

AltStyle によって変換されたページ (->オリジナル) /