[フレーム]
ODP, PDF71,745 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.

Embed presentation

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 Framework - Core
PDF
Spring Framework - Core
Spring Boot
PPTX
Spring Boot
Spring Framework
PPTX
Spring Framework
Introduction to Spring Boot
PPTX
Introduction to Spring Boot
Spring boot
PPTX
Spring boot
Nodejs presentation
PDF
Nodejs presentation
Java Persistence API (JPA) Step By Step
PPT
Java Persistence API (JPA) Step By Step
JPA and Hibernate
PDF
JPA and Hibernate
Spring Framework - Core
Spring Framework - Core
Spring Boot
Spring Boot
Spring Framework
Spring Framework
Introduction to Spring Boot
Introduction to Spring Boot
Spring boot
Spring boot
Nodejs presentation
Nodejs presentation
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By Step
JPA and Hibernate
JPA and Hibernate

What's hot

Spring Boot 3 And Beyond
PDF
Spring Boot 3 And Beyond
WebLogic 12c & WebLogic Mgmt Pack
PDF
WebLogic 12c & WebLogic Mgmt Pack
Introduction to spring boot
PPTX
Introduction to spring boot
Hibernate
PPT
Hibernate
J2ee
PPT
Node js Introduction
PPTX
Node js Introduction
Spring Boot and REST API
PPTX
Spring Boot and REST API
React workshop
PPTX
React workshop
REST APIs with Spring
PDF
REST APIs with Spring
Spring Core
PPT
Spring Core
Spring boot
PPTX
Spring boot
Hibernate Presentation
PDF
Hibernate Presentation
Spring data jpa
PPTX
Spring data jpa
React JS - Introduction
PDF
React JS - Introduction
JPA For Beginner's
PPTX
JPA For Beginner's
Java Spring Framework
PPTX
Java Spring Framework
Hibernate ppt
PPTX
Hibernate ppt
jpa-hibernate-presentation
PPT
jpa-hibernate-presentation
Mvc architecture
PPT
Mvc architecture
JDBC – Java Database Connectivity
PPT
JDBC – Java Database Connectivity
Spring Boot 3 And Beyond
Spring Boot 3 And Beyond
WebLogic 12c & WebLogic Mgmt Pack
WebLogic 12c & WebLogic Mgmt Pack
Introduction to spring boot
Introduction to spring boot
Hibernate
Hibernate
J2ee
Node js Introduction
Node js Introduction
Spring Boot and REST API
Spring Boot and REST API
React workshop
React workshop
REST APIs with Spring
REST APIs with Spring
Spring Core
Spring Core
Spring boot
Spring boot
Hibernate Presentation
Hibernate Presentation
Spring data jpa
Spring data jpa
React JS - Introduction
React JS - Introduction
JPA For Beginner's
JPA For Beginner's
Java Spring Framework
Java Spring Framework
Hibernate ppt
Hibernate ppt
jpa-hibernate-presentation
jpa-hibernate-presentation
Mvc architecture
Mvc architecture
JDBC – Java Database Connectivity
JDBC – Java Database Connectivity

Similar to ORM, JPA, & Hibernate Overview

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

Recently uploaded

Expanding Your Toolbox: Beginners Guide to Controlling Kubernetes Logs
PPTX
Expanding Your Toolbox: Beginners Guide to Controlling Kubernetes Logs
The Future of Database Diagnostics is a Conversation with Oracle AHF Fleet In...
PDF
The Future of Database Diagnostics is a Conversation with Oracle AHF Fleet In...
Automating ArcGIS Enterprise Compliance for Operational Excellence
PDF
Automating ArcGIS Enterprise Compliance for Operational Excellence
Flatpak CLI Application Management & Building on RHEL.pdf
PDF
Flatpak CLI Application Management & Building on RHEL.pdf
Governance, Deployment & Methodologies for Agentic Automation [2/3]
PPTX
Governance, Deployment & Methodologies for Agentic Automation [2/3]
Access Network Attached Storage in RHEL - RHCSA (RH134).pdf
PDF
Access Network Attached Storage in RHEL - RHCSA (RH134).pdf
Upskill to Agentic Automation - Accelerating Your Job Search using AI
PDF
Upskill to Agentic Automation - Accelerating Your Job Search using AI
Improve Command Line Productivity - RHCSA (RH134).pdf
PDF
Improve Command Line Productivity - RHCSA (RH134).pdf
Dr. Robert Krug - Specializes In Predictive Modeling
PDF
Dr. Robert Krug - Specializes In Predictive Modeling
What's Driving Growth in the Video Surveillance Market 2025?
PDF
What's Driving Growth in the Video Surveillance Market 2025?
The Accel 2025 Globalscape: Race for compute
PDF
The Accel 2025 Globalscape: Race for compute
UiPath Veterans Day Acknowledgement and Benefits
PDF
UiPath Veterans Day Acknowledgement and Benefits
Managing SELinux Security - RHCSA (RH134).pdf
PDF
Managing SELinux Security - RHCSA (RH134).pdf
Reset RHEL Root User Password - RHCSA.pdf
PDF
Reset RHEL Root User Password - RHCSA.pdf
Manage Network Security (Firewall) in RHEL - RHCSA (RH134).pdf
PDF
Manage Network Security (Firewall) in RHEL - RHCSA (RH134).pdf
Digital Garage Certification - Google - Viktor Huszag - Online Marketing Fund...
PDF
Digital Garage Certification - Google - Viktor Huszag - Online Marketing Fund...
Sylvester Konadu Worcester MA - An Accomplished IT Analyst
PDF
Sylvester Konadu Worcester MA - An Accomplished IT Analyst
Agile Trailblazers (Scrum Masters, Product Owners, Coaches, Project Managers,...
PDF
Agile Trailblazers (Scrum Masters, Product Owners, Coaches, Project Managers,...
Case Study: How LKQ Corporation Improved Training Efficiency & Delivery
PDF
Case Study: How LKQ Corporation Improved Training Efficiency & Delivery
Building powerful web apps to improve productivity and engagement - Esri UK W...
PPTX
Building powerful web apps to improve productivity and engagement - Esri UK W...
Expanding Your Toolbox: Beginners Guide to Controlling Kubernetes Logs
Expanding Your Toolbox: Beginners Guide to Controlling Kubernetes Logs
The Future of Database Diagnostics is a Conversation with Oracle AHF Fleet In...
The Future of Database Diagnostics is a Conversation with Oracle AHF Fleet In...
Automating ArcGIS Enterprise Compliance for Operational Excellence
Automating ArcGIS Enterprise Compliance for Operational Excellence
Flatpak CLI Application Management & Building on RHEL.pdf
Flatpak CLI Application Management & Building on RHEL.pdf
Governance, Deployment & Methodologies for Agentic Automation [2/3]
Governance, Deployment & Methodologies for Agentic Automation [2/3]
Access Network Attached Storage in RHEL - RHCSA (RH134).pdf
Access Network Attached Storage in RHEL - RHCSA (RH134).pdf
Upskill to Agentic Automation - Accelerating Your Job Search using AI
Upskill to Agentic Automation - Accelerating Your Job Search using AI
Improve Command Line Productivity - RHCSA (RH134).pdf
Improve Command Line Productivity - RHCSA (RH134).pdf
Dr. Robert Krug - Specializes In Predictive Modeling
Dr. Robert Krug - Specializes In Predictive Modeling
What's Driving Growth in the Video Surveillance Market 2025?
What's Driving Growth in the Video Surveillance Market 2025?
The Accel 2025 Globalscape: Race for compute
The Accel 2025 Globalscape: Race for compute
UiPath Veterans Day Acknowledgement and Benefits
UiPath Veterans Day Acknowledgement and Benefits
Managing SELinux Security - RHCSA (RH134).pdf
Managing SELinux Security - RHCSA (RH134).pdf
Reset RHEL Root User Password - RHCSA.pdf
Reset RHEL Root User Password - RHCSA.pdf
Manage Network Security (Firewall) in RHEL - RHCSA (RH134).pdf
Manage Network Security (Firewall) in RHEL - RHCSA (RH134).pdf
Digital Garage Certification - Google - Viktor Huszag - Online Marketing Fund...
Digital Garage Certification - Google - Viktor Huszag - Online Marketing Fund...
Sylvester Konadu Worcester MA - An Accomplished IT Analyst
Sylvester Konadu Worcester MA - An Accomplished IT Analyst
Agile Trailblazers (Scrum Masters, Product Owners, Coaches, Project Managers,...
Agile Trailblazers (Scrum Masters, Product Owners, Coaches, Project Managers,...
Case Study: How LKQ Corporation Improved Training Efficiency & Delivery
Case Study: How LKQ Corporation Improved Training Efficiency & Delivery
Building powerful web apps to improve productivity and engagement - Esri UK W...
Building powerful web apps to improve productivity and engagement - Esri UK W...

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 によって変換されたページ (->オリジナル) /