Top Description Inners Methods
org.hibernate.cfg

public Interface Mappings

Known Direct Subinterfaces
org.hibernate.cfg.ExtendedMappings
Imports
java.io.Serializable, java.util.Iterator, .List, .Properties, .Map, .ListIterator, org.hibernate.AnnotationException, .DuplicateMappingException, .MappingException, org.hibernate.annotations.AnyMetaDef, org.hibernate.annotations.common.reflection.ReflectionManager, .XClass, org.hibernate.id.factory.DefaultIdentifierGeneratorFactory, org.hibernate.engine.FilterDefinition, .NamedQueryDefinition, .NamedSQLQueryDefinition, .ResultSetMappingDefinition, org.hibernate.mapping.Collection, .IdGenerator, .Join, .MetadataSource, .PersistentClass, .Table, .TypeDef, .AuxiliaryDatabaseObject, .Column, .FetchProfile, org.hibernate.persister.PersisterClassProvider, org.hibernate.type.TypeResolver

A collection of mappings from classes and collections to relational database tables. Represents a single <hibernate-mapping> element.

todo : the statement about this representing a single mapping element is simply not true if it was ever the case. this contract actually represents 3 scopes of information:

  1. bounded state : this is information which is indeed scoped by a single mapping
  2. unbounded state : this is information which is Configuration wide (think of metadata repository)
  3. transient state : state which changed at its own pace (naming strategy)
Authors
Gavin King, Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Mappings.PropertyReference

Represents a property-ref mapping.

Method Summary

Modifier and TypeMethod and Description
public void
public void
addAuxiliaryDatabaseObject(AuxiliaryDatabaseObject
The metadata.
auxiliaryDatabaseObject
)

Add metadata pertaining to an auxiliary database object to this repository.

public void
addClass(PersistentClass
The entity metadata
persistentClass
)

Add entity mapping metadata.

public AnnotatedClassType

Returns:

The class type.
addClassType
(XClass
The XClass mapping.
clazz
)

FIXME should be private but will this break things?

public void
addCollection(Collection
The collection metadata
collection
)

Add collection mapping metadata to this repository.

public void
addColumnBinding(String
The logical column name binding.
logicalName
,
Column
The physical column metadata.
physicalColumn
,
Table
The table metadata.
table
)

Binds the given 'physicalColumn' to the give 'logicalName' within the given 'table'.

public void
addDefaultGenerator(IdGenerator
The id generator
generator
)

Adds a default id generator.

public void
public void
public void
public Table

Returns:

The created table metadata.
addDenormalizedTable
(String
The named schema in which the table belongs (or null).
schema
,
String
The named catalog in which the table belongs (or null).
catalog
,
String
The table name
name
,
boolean
Is the table abstract (i.e. not really existing in the DB)?
isAbstract
,
String
A select statement which defines a logical table, much like a DB view.
subselect
,
Table
???
includedTable
)

Adds a 'denormalized table' to this repository.

public void
addFilterDefinition(FilterDefinition
The filter definition to add.
definition
)

Adds a filter definition to this repository.

public void
addGenerator(IdGenerator
The generator to add.
generator
)

Add a generator.

public void
addGeneratorTable(String
The generator name
name
,
Properties
The generator table properties.
params
)

Add a generator table properties.

public void
addImport(String
The entity name being renamed.
entityName
,
String
The rename
rename
)

Adds an import (HQL entity rename) to the repository.

public void
addJoins(PersistentClass
The persistent entity metadata.
persistentClass
,
Map<String, Join>
The join metadata to add.
joins
)

Add join metadata for a persistent entity.

public void
addMappedBy(String entityName, String propertyName, String inversePropertyName)

public void
addMappedSuperclass(Class<T>
type corresponding to the Mappedsuperclass
type
,
MappedSuperclass
MappedSuperclass
mappedSuperclass
)

add a new MappedSuperclass This should not be called if the MappedSuperclass already exists (it would be erased)

public void
public void
public void
addPropertyReference(String
The referenced entity name.
referencedClass
,
String
The referenced property name.
propertyName
)

Adds a property reference binding to this repository.

public void
addPropertyReferencedAssociation(String entityName, String propertyName, String propertyRef)

public void
addQuery(String
The name
name
,
NamedQueryDefinition
The metadata
query
)

Adds metadata for a named query to this repository.

public void
addResultSetMapping(ResultSetMappingDefinition
The metadata
sqlResultSetMapping
)

Adds the metadata for a named SQL result set mapping to this repository.

public void
addSecondPass(SecondPass
The second pass to add.
sp
)

Adds a second-pass to the end of the current queue.

public void
addSecondPass(SecondPass
The second pass to add.
sp
,
boolean
True to add to the beginning of the queue; false to add to the end.
onTopOfTheQueue
)

Adds a second pass.

public void
addSQLQuery(String
The name
name
,
NamedSQLQueryDefinition
The metadata
query
)

Adds metadata for a named SQL query to this repository.

public Table

Returns:

The created table metadata, or the existing reference.
addTable
(String
The named schema in which the table belongs (or null).
schema
,
String
The named catalog in which the table belongs (or null).
catalog
,
String
The table name
name
,
String
A select statement which defines a logical table, much like a DB view.
subselect
,
boolean
Is the table abstract (i.e. not really existing in the DB)?
isAbstract
)

Adds table metadata to this repository returning the created metadata instance.

public void
addTableBinding(String
The schema in which the table belongs (may be null).
schema
,
String
The catalog in which the table belongs (may be null).
catalog
,
String
The logical table name.
logicalName
,
String
The physical table name.
physicalName
,
Table
???
denormalizedSuperTable
)

Adds a table binding to this repository.

public void
addToExtendsQueue(ExtendsQueueEntry
The entry to add.
entry
)

Adds an entry to the extends queue queue.

public void
public void
addTypeDef(String
The type name.
typeName
,
String
The class implementing the org.hibernate.type.Type contract.
typeClass
,
Properties
Map of parameters to be used to configure the type after instantiation.
paramMap
)

Adds a type definition to this metadata repository.

public void
public void
addUniqueConstraints(Table table, List<E> uniqueConstraints)

Deprecated Use addUniqueConstraintHolders instead
public void
addUniquePropertyReference(String
The referenced entity name.
referencedClass
,
String
The referenced property name.
propertyName
)

Adds a property reference binding to this repository where said proeprty reference is marked as unique.

public FetchProfile

Returns:

The fetch profile metadata.
findOrCreateFetchProfile
(String
The name of the profile.
name
,
MetadataSource
The source from which this profile is named.
source
)

Retrieves a fetch profile by either finding one currently in this repository matching the given name or by creating one (and adding it).

public AnyMetaDef
public String

Returns:

The currently bound catalog name, or null if none.
getCatalogName
()

Returns the currently bound default catalog name.

public PersistentClass

Returns:

The entity mapping metadata, or null if none found matching given entity name.
getClass
(String
The entity name for which to retrieve the metadata.
entityName
)

Retrieves the entity mapping metadata for the given entity name.

public Map<K, V>
public AnnotatedClassType

Returns:

The class type.
getClassType
(XClass
The XClass mapping
clazz
)

Get and maintain a cache of class type.

public Collection

Returns:

The collection mapping metadata, or null if no matching collection role found.
getCollection
(String
The collection role for which to retrieve the metadata.
role
)

Retrieves the collection mapping metadata for the given collection role.

public Properties

Returns:

The configuration properties
getConfigurationProperties
()

Retrieve the configuration properties currently in effect.

public String

Returns:

The current default property access style.
getDefaultAccess
()

Get the current default property access style.

public String

Returns:

The current default cascade style.
getDefaultCascade
()

Get the current default cascade style.

public String

Returns:

The currently bound default package name
getDefaultPackage
()

Get the currently bound default package name.

public FilterDefinition

Returns:

The filter definition, or null.
getFilterDefinition
(String
The name of the filter definition to retrieve.
name
)

Retrieves a filter definition by name.

public Map<K, V>

Returns:

The filter definition map.
getFilterDefinitions
()

Retrieves the copmplete map of filter definitions.

public String
getFromMappedBy(String entityName, String propertyName)

public IdGenerator

Returns:

The generator, or null.
getGenerator
(String
The generator name.
name
)

Retrieve the id-generator by name.

public IdGenerator

Returns:

the appropriate idgenerator or null if not found
getGenerator
(String
generator name
name
,
Map<String, IdGenerator>
local generators
localGenerators
)

Try to find the generator from the localGenerators and then from the global generator list

public Properties

Returns:

The properties, or null.
getGeneratorTableProperties
(String
generator name
name
,
Map<String, Properties>
local generator tables
localGeneratorTables
)

Retrieve the properties related to a generator table.

public DefaultIdentifierGeneratorFactory

Returns:

The IdentifierGeneratorFactory
getIdentifierGeneratorFactory
()

Retrieve the IdentifierGeneratorFactory in effect for this mapping.

public Map<String, Join>

Returns:

The join metadata
getJoins
(String
The entity name
entityName
)

Retrieve join metadata for a particular persistent entity.

public String

Returns:

The logical column name.
getLogicalColumnName
(String
The physical column name
physicalName
,
Table
The table metadata.
table
)

Find the logical column name against whcih the given physical column name was bound within the given table.

public String

Returns:

The logical name.
getLogicalTableName
(Table
The table for which to determine the logical name.
table
)

Get the logical table name mapped for the given physical table.

public MappedSuperclass

Returns:

the MappedSuperclass
getMappedSuperclass
(Class<T>
class corresponding to the MappedSuperclass
type
)

Get a MappedSuperclass or null if not mapped

public NamingStrategy

Returns:

The current naming strategy.
getNamingStrategy
()

Get the current naming strategy.

public ObjectNameNormalizer

Returns:

The normalizer.
getObjectNameNormalizer
()

Retrieve the database identifier normalizer for this context.

public PersisterClassProvider
getPersisterClassProvider()

Get the current persister class provider implementation

public String

Returns:

The physical column name.
getPhysicalColumnName
(String
The logical name binding.
logicalName
,
Table
The table metatdata.
table
)

Find the physical column name for the given logical column name within the given table.

public PropertyData
getPropertyAnnotatedWithIdAndToOne(XClass entityType, String propertyName)

Return the property annotated with @ToOne and @Id if any.

public PropertyData
getPropertyAnnotatedWithMapsId(XClass entityType, String propertyName)

Return the property annotated with @MapsId("propertyName") if any.

public String
public NamedQueryDefinition

Returns:

The query metadata, or null.
getQuery
(String
The named query name
name
)

Get named query metadata by name.

public ReflectionManager
public ResultSetMappingDefinition

Returns:

The SQL result set mapping metadat, or null if none found.
getResultSetMapping
(String
The mapping name.
name
)

Get the metadata for a named SQL result set mapping.

public String

Returns:

The currently bound schema name
getSchemaName
()

Returns the currently bound default schema name.

public NamedSQLQueryDefinition

Returns:

The meatdata, or null if none found.
getSQLQuery
(String
The named SQL query name.
name
)

Get named SQL query metadata.

public Table

Returns:

The table metadata, or null.
getTable
(String
The named schema in which the table belongs (or null).
schema
,
String
The named catalog in which the table belongs (or null).
catalog
,
String
The table name
name
)

Returns the named table metadata.

public Map<Table, List<String[]>>
public TypeDef

Returns:

The type definition, or null if none found.
getTypeDef
(String
The name of the type definition to retrieve.
typeName
)

Retrieve a type definition by name.

public TypeResolver

Returns:

The type resolver.
getTypeResolver
()

Retrieve the type resolver in effect.

public Map<Table, List<UniqueConstraintHolder>>
public boolean

Returns:

True if currently enabled; false otherwise.
isAutoImport
()

Determine whether auto importing of entity names is currently enabled.

public boolean

Returns:

True if enabled, false otherwise.
isDefaultLazy
()

Determine whether default laziness is currently enabled.

public boolean
public boolean
public Iterator<AuxiliaryDatabaseObject>

Returns:

Iterator over the auxiliary database object metadata.
iterateAuxiliaryDatabaseObjects
()

Retrieves an iterator over the metadata pertaining to all auxiliary database objects int this repository.

public ListIterator<AuxiliaryDatabaseObject>

Returns:

The reversed iterator.
iterateAuxiliaryDatabaseObjectsInReverse
()

Same as iterateAuxiliaryDatabaseObjects() except that here the iterator is reversed.

public Iterator<AuxiliaryDatabaseObject>
iterateAuxliaryDatabaseObjects()

Deprecated To fix misspelling; use iterateAuxiliaryDatabaseObjects instead
public ListIterator<AuxiliaryDatabaseObject>
public Iterator<PersistentClass>

Returns:

Iterator over class metadata.
iterateClasses
()

Retrieves an iterator over the entity metadata present in this repository.

public Iterator<Collection>

Returns:

Iterator over collection metadata.
iterateCollections
()

Returns an iterator over collection metadata.

public Iterator<Table>

Returns:

Iterator over table metadata.
iterateTables
()

Returns an iterator over table metadata.

public PersistentClass

Returns:

The entity mapping metadata, or null if none found matching given entity name.
locatePersistentClassByEntityName
(String
The entity name for which to retrieve the metadata.
entityName
)

Retrieves the entity mapping metadata for the given entity name, potentially accounting for imports.

public void
setAutoImport(boolean
True to enable; false to diasable.
autoImport
)

Set whether to enable auto importing of entity names.

public void
setCatalogName(String
The catalog name to use as the current default.
catalogName
)

Sets the currently bound default catalog name.

public void
setDefaultAccess(String
The access style to use as the current default.
defaultAccess
)

Sets the current default property access style.

public void
setDefaultCascade(String
The cascade style to set as the current default.
defaultCascade
)

Sets the current default cascade style.

public void
setDefaultLazy(boolean
True to enable, false to disable.
defaultLazy
)

Set whether to enable default laziness.

public void
setDefaultPackage(String
The package name to set as the current default.
defaultPackage
)

Set the current default package name.

public void
setNamingStrategy(NamingStrategy
The naming strategy to use.
namingStrategy
)

Set the current naming strategy.

public void
setPersisterClassProvider(PersisterClassProvider persisterClassProvider)

Set the current persister class provider implementation

public void
setSchemaName(String
The schema name to bind as the current default.
schemaName
)

Sets the currently bound default schema name.

public boolean

Returns:

True if the new generators should be used, false otherwise.
useNewGeneratorMappings
()

Should we use the new generator strategy mappings.