SlideShare a Scribd company logo
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM:
Powerful Hibernate ORM
Features and Capabilities
Brett Meyer
Senior Software Engineer
Hibernate ORM, Red Hat
Brett Meyer
• 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 #hibernate or #hibernate-dev (brmeyer)
github.com/brmeyer
/HibernateDemos

slideshare.net/brmeyer
ORM? JPA?
• ORM: Object/Relational Mapping
– Persistence: Data objects outlive the JVM app
– Maps Java POJOs to relational databases
– Supports OO concepts: inheritance, object identity, etc.
– Navigate data by walking the object graph, not the explicit
relational model

• JPA: Java Persistence API
• Hibernate ORM provides its own native API, in
addition to full JPA support
• Annotations and XML
Overview
•
•
•
•
•
•
•
•
•

Multi-Tenancy
Value Generation
Hibernate Spatial
Hibernate Envers
Hibernate OSGi
Hibernate Search
Hibernate OGM & Validator
Hibernate Shards
Ask questions after each section!
Multi-Tenancy
Multi-Tenancy
•
•
•
•

1 ORM instance
Multiple concurrent clients
Data specific to each tenant
Legacy
– Separate SessionFactories for each tenant
– Application-provided Connections (given when
opening a Session)
– Big schemas or many tenants = huge footprint
Hibernate ORM
Multi-Tenancy
•
•
•
•

Strategy selection is global
Tenant identifier provided when opening a Session
Works with 2LC: identifier used in cache data key
Custom impls:
– MultiTenantConnectionProvider: required for physical
and schema separated (required)
– CurrentTenantIdentifierResolver: required for opening a
Session without providing the tenant id (explicitly or
Session#getCurrentSession)
Hibernate ORM
Multi-Tenancy Strategies
• Physically separated databases
– 1 JDBC connection pool per tenant
– Pool selected based on tenant identifier

• Single database, separate schemas
– Option #1
• Similar to physically separated
• 1 JDBC connection pool per tenant
• Provides schema through the connection URL or pool

– Option #2:
• 1 JDBC connection pool using a default schema
• Each Connection altered with SQL “SET SCHEMA” prior to use
Hibernate ORM
Multi-Tenancy Strategies
• Single database and schema
– Data partitioned by discriminator value
– Discriminator complexity varies
– Each SQL statement altered to include the
discriminator
– Not yet implemented (planned for ORM 5)
– Alternative: @FilterDef/@Filter w/ a
tenantId as a param
Hibernate ORM
Multi-Tenancy
• DEMO
• Questions?
Value Generation
Value Generation (Legacy)
• Limited to in-database value generation
on insert/update
• Properties marked with @Generated
immediately selected
Hibernate ORM
Value Generation
•
•
•
•

New, expanded support in ORM 4.3
Supports legacy in-DB generation, but also in-mem
Create custom annotations!
ORM provides built in generators
– @Generated: legacy, providing in-database generation
– @CreationTimestamp: set only once when owning entity is saved for
the first time
– @UpdateTimestamp: set any time owning entity is saved
– @GeneratorType: provide custom in-memory generator and define
“when”

• DEMO
• Questions?
Hibernate Spatial
Hibernate Spatial
• Currently 3rd party, but pulling in as a new ORM module in 5
• Originally created by Karel Maesen (geovise.com)
• Java Topology Suite (JTS)
– OpenGIS Simple Feature Spec (SFS) & SQL/MM Spatial (extends SFS)
– Oracle, Postgres, MySQL, MS SQL, H2, etc. all implement the specs
– Attempts to provide abstract, cross-platform geo data, but diffs between
them

• geolatte-geom
– Developed/maintained by Karel
– Improvement over JTS
– Fully interoperable with JTS
– Support for lat/lon geographies
– Additional Dialect differences
Hibernate Spatial (cont'd)
• Properties use JTS Geometry types
– Point
– LineString
– Polygon
– etc.

• Adds HQL functions for Dialect-supported methods
– Same functions also implemented as Criteria API Criterions
– ex: "select e from Event e where within(e.location, :filter) =
true" (:filter is a Geometry)
– http://www.hibernatespatial.org/documentation/03-dialects/0
1-overview/
Hibernate Spatial (cont'd)
• Translates between “Well-known text” (WKT) and
Geometry types
– Spatial object markup language
– 2D and 3D
– ex: “POINT (30 10)”, “POLYGON ((30 10, 40 40, 20 40, 10 20,
30 10))”

• Coordinate system transformations possible in queries
• Does not require JDBC extension drivers (ex: Oracle
SDOAPI.jar or Postgres postgis.jar)
• DEMO
• Questions?
Hibernate Envers
Hibernate Envers
• Provides historical versioning and auditing (“SCM for data”)
• Each transaction == a “revision”
• Revision #s are global --> querying for a historical snapshot
of the entire database is possible
• Requires
– @Audited on the entity or individual properties
– [entity]_AUD tables to store the historical data (DDL created
automated if using hbm2ddl, otherwise it’s exportable)

• Duplicate data? Yes.
• Powerful queries/capabilities > cheap mem
• Highly configurable
Hibernate Envers (cont'd)
• Revision info
– Default: simple internal entity stored in REVINFO table
– Revision # and revision timestamp
– Override with custom @RevisionEntity & RevisionListener
(add other useful fields: IP address, “blame”, etc.)

• Revision entity types
– Track the entity types that were changed in each revision
– Disabled by default: requires querying tables for changed
data
– Can be overridden by implementing
EntityTrackingRevisionListener on your RevisionEntity
Hibernate Envers (cont'd)
• Revision properties
– Track the entity properties that were changed in each revision
– Disabled by default: requires querying tables for changed data
– Adds boolean columns to audit tables

• Queries
– Snapshot of entity states at a given revision (horizontal)
– Revisions at which entities changed (vertical)

• DEMO
• Questions?
• Conditional auditing
– Default: Envers auditing reacts to Hibernate ORM events
– Disable hibernate.listeners.envers.autoRegister, create your own listeners,
wire them in using Integrator
Hibernate OSGi
Hibernate OSGi
• OSGi?
• Provide only the OSGi manifest and hacky workarounds <-NO!
• Emphasize doing things “the OSGi way”
– Dynamic environment
– Scoping
• Limited visibility into the container
• No scanning all bundles
• Reduced conflicts, allows concurrent instances, etc.

– OSGi services

• Isolated in hibernate-osgi module (no pervasive
dependencies or OSGi code)
Hibernate OSGi (cont'd)
• 3 supported environments
– Enterprise OSGi Managed JPA
• Container discovers and manages persistence units and EntityManagerFactories
• Similar to many app servers, Spring, etc.
• Ex: Apache Aries JPA

– Un-managed JPA
• Direct use of hibernate-entitymanager
• EntityManagerFactories created through OSGi services

– Native
• Direct use of hibernate-core
• SessionFactories created through OSGi services

• Quickstarts
• Questions?
Hibernate Search
Hibernate Search
• Full-text search on the DB
– Bad performance
– CPU/IO overhead

• Offload full-text queries to Hibernate Search
engine
– Fully indexed
– Horizontally scalable

• Based on Apache Lucene
• “Google for your entities”
Hibernate Search (cont'd)
• Annotate entities with @Indexed
• Annotate properties with @Field
– Index the text: index=Index.YES
– “Analyze” the text: analyze=Analyze.YES
•
•
•
•
•

Lucene analyzer
Chunks sentences into words
Lowercase all of them
Exclude common words (“a”, “the”)
Stemming
Hibernate OGM &
Hibernate Validator
Hibernate OGM & Validator
• Hibernate OGM:
– ORM/JPA support for NoSQL
– Infinispan, EHCache, MongoDB, Neo4j

• Hibernate Validator
– Bean Validation impl, but extended
– Both annotation and XML based
– @NotNull, @Size(min = 2, max = 14),
@Min(2), etc.
Hibernate Shards
Hibernate Shards
• Started as a Google team's 20% project
• Horizontal partitioning across multiple databases
• Flexible sharding strategies, both provided and
custom
• Supports virtual shards: simplifies re-sharding
• Typical Hibernate ORM usage: HQL, Criteria, etc.
• Last supported ORM version: 3.6.x
• Currently has upgrade momentum – contact
me if interested!
How to Help:
hibernate.org
/orm/contribute
Hibernate ORM:
Tips, Tricks, and
Performance Techniques

Tomorrow, 1pm,
Ballroom D
QUESTIONS?
•
•
•
•

Q&A
#hibernate or #hibernate-dev (brmeyer)
@brettemeyer
+brettmeyer

More Related Content

What's hot (20)

PDF
DevOps for Databricks
Databricks
 
PDF
Spark Operator—Deploy, Manage and Monitor Spark clusters on Kubernetes
Databricks
 
PDF
SQL Server Tuning to Improve Database Performance
Mark Ginnebaugh
 
PDF
Intro to HBase
alexbaranau
 
PPTX
Hive 3 - a new horizon
Thejas Nair
 
PDF
HiveServer2 for Apache Hive
Carl Steinbach
 
PDF
REST API and CRUD
Prem Sanil
 
PDF
Declarative Clients in Spring
VMware Tanzu
 
PDF
Oracle db performance tuning
Simon Huang
 
PPTX
RESTful API - Best Practices
Tricode (part of Dept)
 
PPTX
HBase Low Latency
DataWorks Summit
 
PDF
HDFS on Kubernetes—Lessons Learned with Kimoon Kim
Databricks
 
PPTX
Hive + Tez: A Performance Deep Dive
DataWorks Summit
 
PPTX
Oak, the architecture of Apache Jackrabbit 3
Jukka Zitting
 
PPT
Hibernate architecture
Anurag
 
PPTX
ORC improvement in Apache Spark 2.3
DataWorks Summit
 
PPTX
Hive: Loading Data
Benjamin Leonhardi
 
PDF
Oracle LOB Internals and Performance Tuning
Tanel Poder
 
PPTX
Apache Hive Tutorial
Sandeep Patil
 
PPTX
Reactive solutions using java 9 and spring reactor
OrenEzer1
 
DevOps for Databricks
Databricks
 
Spark Operator—Deploy, Manage and Monitor Spark clusters on Kubernetes
Databricks
 
SQL Server Tuning to Improve Database Performance
Mark Ginnebaugh
 
Intro to HBase
alexbaranau
 
Hive 3 - a new horizon
Thejas Nair
 
HiveServer2 for Apache Hive
Carl Steinbach
 
REST API and CRUD
Prem Sanil
 
Declarative Clients in Spring
VMware Tanzu
 
Oracle db performance tuning
Simon Huang
 
RESTful API - Best Practices
Tricode (part of Dept)
 
HBase Low Latency
DataWorks Summit
 
HDFS on Kubernetes—Lessons Learned with Kimoon Kim
Databricks
 
Hive + Tez: A Performance Deep Dive
DataWorks Summit
 
Oak, the architecture of Apache Jackrabbit 3
Jukka Zitting
 
Hibernate architecture
Anurag
 
ORC improvement in Apache Spark 2.3
DataWorks Summit
 
Hive: Loading Data
Benjamin Leonhardi
 
Oracle LOB Internals and Performance Tuning
Tanel Poder
 
Apache Hive Tutorial
Sandeep Patil
 
Reactive solutions using java 9 and spring reactor
OrenEzer1
 

Similar to Not Just ORM: Powerful Hibernate ORM Features and Capabilities (20)

PDF
Hibernate 3
Rajiv Gupta
 
PPTX
Hibernate in Action
Akshay Ballarpure
 
PDF
Free Hibernate Tutorial | VirtualNuggets
Virtual Nuggets
 
PPT
Why hibernater1
rajeevkuruganti
 
PPT
Basic Hibernate Final
Rafael Coutinho
 
PPT
Hibernate
Preetha Ganapathi
 
PPT
Hibernate Tutorial
Ram132
 
PPTX
Ups and downs of enterprise Java app in a research setting
Csaba Toth
 
PPT
Hibernate
Murali Pachiyappan
 
PPTX
Module-3 for career and JFSD ppt for study.pptx
ViratKohli78
 
PPTX
Hibernate in XPages
Toby Samples
 
PPT
Patni Hibernate
patinijava
 
DOCX
What is hibernate?
kanchanmahajan23
 
PPT
Hibernate jj
Joe Jacob
 
PPT
Hibernate
Ajay K
 
PPT
Hibernate introduction
Sagar Verma
 
PPTX
Hibernate tutorial
Mumbai Academisc
 
PDF
Hibernate complete notes_by_sekhar_sir_javabynatara_j
Satya Johnny
 
PDF
Hibernate complete notes_by_sekhar_sir_javabynatara_j
Satya Johnny
 
PDF
What is hibernate?
kanchanmahajan23
 
Hibernate 3
Rajiv Gupta
 
Hibernate in Action
Akshay Ballarpure
 
Free Hibernate Tutorial | VirtualNuggets
Virtual Nuggets
 
Why hibernater1
rajeevkuruganti
 
Basic Hibernate Final
Rafael Coutinho
 
Hibernate Tutorial
Ram132
 
Ups and downs of enterprise Java app in a research setting
Csaba Toth
 
Module-3 for career and JFSD ppt for study.pptx
ViratKohli78
 
Hibernate in XPages
Toby Samples
 
Patni Hibernate
patinijava
 
What is hibernate?
kanchanmahajan23
 
Hibernate jj
Joe Jacob
 
Hibernate
Ajay K
 
Hibernate introduction
Sagar Verma
 
Hibernate tutorial
Mumbai Academisc
 
Hibernate complete notes_by_sekhar_sir_javabynatara_j
Satya Johnny
 
Hibernate complete notes_by_sekhar_sir_javabynatara_j
Satya Johnny
 
What is hibernate?
kanchanmahajan23
 
Ad

Recently uploaded (20)

PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pdf
ghjghvhjgc
 
PPTX
Essential Content-centric Plugins for your Website
Laura Byrne
 
PDF
Modern Decentralized Application Architectures.pdf
Kalema Edgar
 
PPTX
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
Hitachi, Ltd. OSS Solution Center.
 
PDF
Evolution: How True AI is Redefining Safety in Industry 4.0
vikaassingh4433
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
Software Development Company Keene Systems, Inc (1).pdf
Custom Software Development Company | Keene Systems, Inc.
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PPTX
Talbott's brief History of Computers for CollabDays Hamburg 2025
Talbott Crowell
 
PPTX
Wondershare Filmora Crack Free Download 2025
josanj305
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
NASA A Researcher’s Guide to International Space Station : Earth Observations
Dr. PANKAJ DHUSSA
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pdf
ghjghvhjgc
 
Essential Content-centric Plugins for your Website
Laura Byrne
 
Modern Decentralized Application Architectures.pdf
Kalema Edgar
 
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
Hitachi, Ltd. OSS Solution Center.
 
Evolution: How True AI is Redefining Safety in Industry 4.0
vikaassingh4433
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Software Development Company Keene Systems, Inc (1).pdf
Custom Software Development Company | Keene Systems, Inc.
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Talbott's brief History of Computers for CollabDays Hamburg 2025
Talbott Crowell
 
Wondershare Filmora Crack Free Download 2025
josanj305
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Digital Circuits, important subject in CS
contactparinay1
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
NASA A Researcher’s Guide to International Space Station : Earth Observations
Dr. PANKAJ DHUSSA
 
Ad

Not Just ORM: Powerful Hibernate ORM Features and Capabilities

  • 2. Not Just ORM: Powerful Hibernate ORM Features and Capabilities Brett Meyer Senior Software Engineer Hibernate ORM, Red Hat
  • 3. Brett Meyer • 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 #hibernate or #hibernate-dev (brmeyer)
  • 5. ORM? JPA? • ORM: Object/Relational Mapping – Persistence: Data objects outlive the JVM app – Maps Java POJOs to relational databases – Supports OO concepts: inheritance, object identity, etc. – Navigate data by walking the object graph, not the explicit relational model • JPA: Java Persistence API • Hibernate ORM provides its own native API, in addition to full JPA support • Annotations and XML
  • 6. Overview • • • • • • • • • Multi-Tenancy Value Generation Hibernate Spatial Hibernate Envers Hibernate OSGi Hibernate Search Hibernate OGM & Validator Hibernate Shards Ask questions after each section!
  • 8. Multi-Tenancy • • • • 1 ORM instance Multiple concurrent clients Data specific to each tenant Legacy – Separate SessionFactories for each tenant – Application-provided Connections (given when opening a Session) – Big schemas or many tenants = huge footprint
  • 9. Hibernate ORM Multi-Tenancy • • • • Strategy selection is global Tenant identifier provided when opening a Session Works with 2LC: identifier used in cache data key Custom impls: – MultiTenantConnectionProvider: required for physical and schema separated (required) – CurrentTenantIdentifierResolver: required for opening a Session without providing the tenant id (explicitly or Session#getCurrentSession)
  • 10. Hibernate ORM Multi-Tenancy Strategies • Physically separated databases – 1 JDBC connection pool per tenant – Pool selected based on tenant identifier • Single database, separate schemas – Option #1 • Similar to physically separated • 1 JDBC connection pool per tenant • Provides schema through the connection URL or pool – Option #2: • 1 JDBC connection pool using a default schema • Each Connection altered with SQL “SET SCHEMA” prior to use
  • 11. Hibernate ORM Multi-Tenancy Strategies • Single database and schema – Data partitioned by discriminator value – Discriminator complexity varies – Each SQL statement altered to include the discriminator – Not yet implemented (planned for ORM 5) – Alternative: @FilterDef/@Filter w/ a tenantId as a param
  • 14. Value Generation (Legacy) • Limited to in-database value generation on insert/update • Properties marked with @Generated immediately selected
  • 15. Hibernate ORM Value Generation • • • • New, expanded support in ORM 4.3 Supports legacy in-DB generation, but also in-mem Create custom annotations! ORM provides built in generators – @Generated: legacy, providing in-database generation – @CreationTimestamp: set only once when owning entity is saved for the first time – @UpdateTimestamp: set any time owning entity is saved – @GeneratorType: provide custom in-memory generator and define “when” • DEMO • Questions?
  • 17. Hibernate Spatial • Currently 3rd party, but pulling in as a new ORM module in 5 • Originally created by Karel Maesen (geovise.com) • Java Topology Suite (JTS) – OpenGIS Simple Feature Spec (SFS) & SQL/MM Spatial (extends SFS) – Oracle, Postgres, MySQL, MS SQL, H2, etc. all implement the specs – Attempts to provide abstract, cross-platform geo data, but diffs between them • geolatte-geom – Developed/maintained by Karel – Improvement over JTS – Fully interoperable with JTS – Support for lat/lon geographies – Additional Dialect differences
  • 18. Hibernate Spatial (cont'd) • Properties use JTS Geometry types – Point – LineString – Polygon – etc. • Adds HQL functions for Dialect-supported methods – Same functions also implemented as Criteria API Criterions – ex: "select e from Event e where within(e.location, :filter) = true" (:filter is a Geometry) – http://www.hibernatespatial.org/documentation/03-dialects/0 1-overview/
  • 19. Hibernate Spatial (cont'd) • Translates between “Well-known text” (WKT) and Geometry types – Spatial object markup language – 2D and 3D – ex: “POINT (30 10)”, “POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))” • Coordinate system transformations possible in queries • Does not require JDBC extension drivers (ex: Oracle SDOAPI.jar or Postgres postgis.jar) • DEMO • Questions?
  • 21. Hibernate Envers • Provides historical versioning and auditing (“SCM for data”) • Each transaction == a “revision” • Revision #s are global --> querying for a historical snapshot of the entire database is possible • Requires – @Audited on the entity or individual properties – [entity]_AUD tables to store the historical data (DDL created automated if using hbm2ddl, otherwise it’s exportable) • Duplicate data? Yes. • Powerful queries/capabilities > cheap mem • Highly configurable
  • 22. Hibernate Envers (cont'd) • Revision info – Default: simple internal entity stored in REVINFO table – Revision # and revision timestamp – Override with custom @RevisionEntity & RevisionListener (add other useful fields: IP address, “blame”, etc.) • Revision entity types – Track the entity types that were changed in each revision – Disabled by default: requires querying tables for changed data – Can be overridden by implementing EntityTrackingRevisionListener on your RevisionEntity
  • 23. Hibernate Envers (cont'd) • Revision properties – Track the entity properties that were changed in each revision – Disabled by default: requires querying tables for changed data – Adds boolean columns to audit tables • Queries – Snapshot of entity states at a given revision (horizontal) – Revisions at which entities changed (vertical) • DEMO • Questions? • Conditional auditing – Default: Envers auditing reacts to Hibernate ORM events – Disable hibernate.listeners.envers.autoRegister, create your own listeners, wire them in using Integrator
  • 25. Hibernate OSGi • OSGi? • Provide only the OSGi manifest and hacky workarounds <-NO! • Emphasize doing things “the OSGi way” – Dynamic environment – Scoping • Limited visibility into the container • No scanning all bundles • Reduced conflicts, allows concurrent instances, etc. – OSGi services • Isolated in hibernate-osgi module (no pervasive dependencies or OSGi code)
  • 26. Hibernate OSGi (cont'd) • 3 supported environments – Enterprise OSGi Managed JPA • Container discovers and manages persistence units and EntityManagerFactories • Similar to many app servers, Spring, etc. • Ex: Apache Aries JPA – Un-managed JPA • Direct use of hibernate-entitymanager • EntityManagerFactories created through OSGi services – Native • Direct use of hibernate-core • SessionFactories created through OSGi services • Quickstarts • Questions?
  • 28. Hibernate Search • Full-text search on the DB – Bad performance – CPU/IO overhead • Offload full-text queries to Hibernate Search engine – Fully indexed – Horizontally scalable • Based on Apache Lucene • “Google for your entities”
  • 29. Hibernate Search (cont'd) • Annotate entities with @Indexed • Annotate properties with @Field – Index the text: index=Index.YES – “Analyze” the text: analyze=Analyze.YES • • • • • Lucene analyzer Chunks sentences into words Lowercase all of them Exclude common words (“a”, “the”) Stemming
  • 31. Hibernate OGM & Validator • Hibernate OGM: – ORM/JPA support for NoSQL – Infinispan, EHCache, MongoDB, Neo4j • Hibernate Validator – Bean Validation impl, but extended – Both annotation and XML based – @NotNull, @Size(min = 2, max = 14), @Min(2), etc.
  • 33. Hibernate Shards • Started as a Google team's 20% project • Horizontal partitioning across multiple databases • Flexible sharding strategies, both provided and custom • Supports virtual shards: simplifies re-sharding • Typical Hibernate ORM usage: HQL, Criteria, etc. • Last supported ORM version: 3.6.x • Currently has upgrade momentum – contact me if interested!
  • 35. Hibernate ORM: Tips, Tricks, and Performance Techniques Tomorrow, 1pm, Ballroom D