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 SessionFactoryImpl, which simply passes them along on to an object which implements MappingMetamodel and uses them to create persister objects for entities and collections.
  3. The model objects are used directly in the constructors of EntityMetamodel, AbstractEntityPersister, 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