Top Description Interfaces Classes Enums
[default module]

Package org.hibernate.mapping


This package defines the Hibernate configuration-time mapping model. The objects defined in this package are produced by the annotation binding process, and consumed by the code with builds persisters and loaders. They do not outlive the configuration process.

The mapping model objects represent:

The lifecycle of these mapping objects is outlined below.

  1. It is the responsibility of the metadata binders in the package org.hibernate.boot.model.internal to process a set of annotated classes and produce fully-initialized mapping model objects. This is in itself a complicated multi-phase process, since, for example, the type of an association mapping in one entity cannot be fully assigned until the target entity has been processed.
  2. The mapping model objects are then passed to the constructor of org.hibernate.internal.SessionFactoryImpl, which simply passes them along on to an object which implements org.hibernate.metamodel.MappingMetamodel and uses them to create persister objects for entities and collections.
  3. The model objects are used directly in the constructors of org.hibernate.tuple.entity.EntityMetamodel, org.hibernate.persister.entity.AbstractEntityPersister, org.hibernate.persister.collection.AbstractCollectionPersister, and friends, to build up the internal data structures used by these objects at runtime. Once the persisters are fully-constructed, the mapping model objects are no longer useful.
  4. The mapping model objects are also passed to the schema export tooling which uses them directly to produce DDL.
See Also
org.hibernate.boot

Interface Summary

Modifier and TypeInterface and Description
public interface
AttributeContainer

Identifies a mapping model object which may have attributes (fields or properties).

public interface
Contributable

Parts of the mapping model which are associated with a contributor (ORM, Envers, etc).

public interface
Fetchable

Any mapping with an outer-join attribute

public interface
Filterable

Defines mapping elements to which filters may be applied.

public interface
public interface
IdentifiableTypeClass

Commonality between PersistentClass and MappedSuperclass, what JPA calls an identifiable type.

public interface
public interface
IndexedBiConsumer<T, U>

A consumer like java.util.function.BiConsumer but also accepts an integer as index.
public interface
IndexedConsumer<T>

A consumer like java.util.function.Consumer but also accepts an integer as index.
public interface
KeyValue

A mapping model Value which may be treated as an identifying key of a relational database table.

public interface
MetaAttributable

Common interface for things that can handle meta attributes.

public interface
public interface
public interface
Selectable

Models the commonality between a Column and a Formula (computed value).

public interface
SemanticsResolver

Deprecated this is no longer used
public interface
public interface
public interface
TableContainer

Container for Table and Join reference

public interface
TableOwner

Optional contract implemented by some subtypes of PersistentClass.

public interface
Value

A mapping model object which represents something that's persisted "by value", instead of "by reference", that is, anything with no primary key.

public interface

Class Summary

Modifier and TypeClass and Description
public class
AggregateColumn

An aggregate column is a column of type org.hibernate.type.SqlTypes#STRUCT, org.hibernate.type.SqlTypes#JSON or org.hibernate.type.SqlTypes#SQLXML that aggregates a component into a single column.

public class
Any

A mapping model object representing a polymorphic association to one of several tables.

public class
Array

An array mapping has a primary key consisting of the key columns + index column.

public class
public class
Bag

A mapping model object representing a collection of type java.util.Collection which may contain duplicates.

public class
public class
CheckConstraint

Represents a table or column level check constraint.

public abstract class
Collection

A mapping model object representing a collection.

public class
Column

A mapping model object representing a column of a relational database table.

public class
Component

A mapping model object that represents an embeddable class.

public abstract class
Constraint

A mapping model object representing a constraint on a relational database table.

public class
public class
public class
DependantValue

A mapping model object representing a value which is "typed" by reference to some other value (for example, a foreign key is typed by the referenced primary key).

public class
FetchProfile

A mapping model object representing a org.hibernate.annotations.FetchProfile.

public class
ForeignKey

A mapping model object representing a foreign key constraint.

public class
Formula

A mapping model object representing a SQL formula which is used as a "derived" Column in an entity mapping.

public class
IdentifierBag

A bag with a generated (surrogate) key.

public abstract class
IdentifierCollection

A mapping model object representing a collection with a synthetic "identifier" column, that is, a surrogate key.

public class
IdGenerator

Deprecated since 6.2. this class is no longer used
Identifier generator container, Useful to keep named generator in annotations
public class
Index

A mapping model object representing an index on a relational database table.

public class
public abstract class
IndexedCollection

Indexed collections include Lists, Maps, arrays and primitive arrays.

public class
Join

A mapping model object representing some sort of auxiliary table, for example, an association table, a secondary table, or a table belonging to a joined subclass.

public class
JoinedSubclass

A mapping model object that represents a subclass in a "joined" or "table per subclass" inheritance hierarchy.

public class
List

A mapping model object representing a collection of type java.util.List.

public class
ManyToOne

A mapping model object representing a many-to-one association.

public class
Map

A mapping model object representing a collection of type java.util.Map.

public class
MappedSuperclass

A mapping model object representing a mapped superclass of an entity class.

public class
public class
MetaAttribute

A meta attribute is a named value or values.

public class
OneToMany

A mapping model object representing a many-to-one association.

public class
OneToOne

A mapping model object representing a many-to-one association.

public abstract class
PersistentClass

A mapping model object that represents an entity class.

public class
PrimaryKey

A mapping model object representing a primary key constraint.

public class
PrimitiveArray

A primitive array has a primary key consisting of the key columns + index column.

public class
Property

A mapping model object representing a property or field of an entity or embeddable class.

public class
PropertyGeneration

Deprecated This is replaced by org.hibernate.tuple.ValueGeneration and org.hibernate.tuple.GenerationTiming, and is no longer used
Indicates whether given properties are generated by the database and, if so, at what time(s) they are generated.
public class
RootClass

A mapping model object that represents the root class in an entity class inheritance hierarchy.

public class
Set

A mapping model object representing a collection of type java.util.List.

public abstract class
SimpleValue

A mapping model object that represents any value that maps to columns.

public class
SingleTableSubclass

A mapping model object that represents a subclass in a single table inheritance hierarchy.

public class
Subclass

A mapping model object that represents a subclass in an entity class inheritance hierarchy.

public class
SyntheticProperty

Models a property which does not actually exist in the model.

public class
Table

A mapping model object representing a relational database table.

public abstract class
ToOne

A mapping model object representing an association where the target side has cardinality one.

public class
TypeDef

Deprecated no longer used
Placeholder for typedef information
public class
UnionSubclass

A mapping model object that represents a subclass in a "union" or "table per concrete class" inheritance hierarchy.

public class
UniqueKey

A mapping model object representing a unique key constraint on a relational database table.

public class
UserDefinedType

A mapping model object representing a relational database UDT.

Enum Summary

Modifier and TypeEnum and Description
public enum
MetadataSource

Enumeration of the known places from which a piece of metadata may come.