Member Menu
 
 Monthly JBoss newsletter:
 
Hibernate Books
CaveatEmptor
«   Transparent Persistence

Hibernate Feature List

Query Facilities   »

Flexible Mapping

Three basic inheritance mapping strategies

Three mapping strategies are supported:

  • table-per-class-hierarchy
  • table-per-subclass (normalized mapping)
  • table-per-concrete-class
  • mixed table-per-hierarchy / table-per-subclass strategy

Both column based and content based type discrimination are supported for table-per-hierarchy and table-per-subclass mappings!

Polymorphic associations

For all three mapping strategies!

  • Many-to-one: An object reference transparently mapped to a foreign key association or an association table
  • One-to-many: A collection of objects transparently mapped to a foreign key association or an association table
  • Many-to-many: A collection of objects transparently mapped to an association table
  • One-to-one: An object reference transparently mapped to a primary key, or unique foreign key association or an association table
  • Ternary: A Map containing and keyed by objects mapped to a ternary association (with or without an association table)

Any association may be mapped to a foreign key which references a non-primary unique key

Foreign keys themselves may even be composed of columns, SQL formulas and/or literals

Bidirectional associations

for all association styles

Transitive persistence

Associations may be configured for cascading save, delete, and/or reattachment. This is our approach to what some projects call "persistence by reachablity" or "dependent objects". Hibernate's approach gives maximimum flexibility and performance.

Hibernate Filters

A unique, innovative feature for handling temporal, regional or permissioned data efficiently and elegantly in ORM

Multiple-objects to single-row mapping

"Components" allow for use of fine-grained object composition

Single-object to multiple-table mapping

Properties of a single class may be arbitarily mapped across several tables

Derived entities and attributes

  • Properties may be mapped to SQL formulas (or even subselects)
  • Classes may be mapped to (handwritten) SQL subselects

Collections of basic types

Collections of strings, dates, numbers, components, etc.

Indexed collections

maps, lists, arrays may be persisted as key-value pairs

Composite Collection Elements

Allows an object oriented representation of:

  • extra data in many to many association (match) tables
  • ternary (and quaternary, etc) associations

Support for hand-written SQL

Hibernate's generated SQL may be anywhere overridden by handwritten SQL embedded in the mapping document

Support for stored procedures

It is even possible to call a stored procedures for create/update/delete, or as a query

Multiple surrogate key generation strategies

including built-in support for

  • identity (autoincrement) columns
  • sequences
  • UUID algorithm
  • HI/LO algorithm
  • database-generated GUIDs

Support for natural and composite keys

Primary keys may span multiple properties of a class, or may be defined in a seperate primary key class

© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]