Java Persistence with Hibernate

Object Relational Mapping (ORM)

Hibernate

Benefits

Productivity

lets you concentrate on the business problem

Maintainability

reduces lines of code (LOC)

Performance

efficient and easily tunable caching in the application tier

Vendor independence

mitigate some of the risks associated with vendor lock-in

object persistence

outlive their application process

saved to a data store

can be re-created later

ORM impedance Mismatch

conceptual and technical difficulties

often encountered when a relational database management system (RDBMS)

when objects or class definitions aren't mapped to database tables defined by a relational schema

ORM

a collection of data management tools

Hibernate Suite

Hibernate Validator

Hibernate Envers

Hibernate EntityManager

Hibernate Search

Hibernate ORM

Hibernate OGM

consists of a core

base service for persis- tence with SQL databases

a native proprietary API

foundation for several of the other projects

implementation of the standard Java Persistence APIs

optional module you can stack on top of Hibernate ORM

Independent of other Hibernate projects

provides declarative validation for your domain model

dedicated to audit logging

keeps multiple versions of data in your SQL database

helps you add data history and audit trails to your application

keeps an index of your domain model data up to date

lets you query this database using integrated API

adds full-text search capabilities if added to Hibernate ORM

object/grid mapper

provides JPA support for NoSQL solutions

persisting mapped entities into a key/value

persistence unit

pairing of your domain model

class mappings with a database connection

every application has at least one persistence unit

EntityManagerFactory

talks to the datbase

Java Persistence Query Language (JPQL)

Object Oriented Query Language

part of JPA specification

queries against entities stored in a relational database

operate against JPA entity objects rather than directly with database tables