org.hibernate.cfg
Class Configuration.MappingsImpl

java.lang.Object
  extended by org.hibernate.cfg.Configuration.MappingsImpl
All Implemented Interfaces:
Serializable, ExtendedMappings, Mappings
Direct Known Subclasses:
AnnotationConfiguration.ExtendedMappingsImpl
Enclosing class:
Configuration

protected class Configuration.MappingsImpl
extends Object
implements ExtendedMappings, Serializable

Internal implementation of the Mappings interface giving access to the Configuration's internal metadata repository state (Configuration.classes, Configuration.tables, etc).

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.hibernate.cfg.Mappings
Mappings.PropertyReference
 
Constructor Summary
protected Configuration.MappingsImpl()
           
 
Method Summary
 void addAnyMetaDef(AnyMetaDef defAnn)
           
 void addAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject)
          Add metadata pertaining to an auxiliary database object to this repository.
 void addClass(PersistentClass persistentClass)
          Add entity mapping metadata.
 AnnotatedClassType addClassType(org.hibernate.annotations.common.reflection.XClass clazz)
          FIXME should be private but will this break things? Add a class type.
 void addCollection(Collection collection)
          Add collection mapping metadata to this repository.
 void addColumnBinding(String logicalName, Column physicalColumn, Table table)
          Binds the given 'physicalColumn' to the give 'logicalName' within the given 'table'.
 void addDefaultGenerator(IdGenerator generator)
          Adds a default id generator.
 void addDefaultQuery(String name, NamedQueryDefinition query)
           
 void addDefaultResultSetMapping(ResultSetMappingDefinition definition)
           
 void addDefaultSQLQuery(String name, NamedSQLQueryDefinition query)
           
 Table addDenormalizedTable(String schema, String catalog, String name, boolean isAbstract, String subselect, Table includedTable)
          Adds a 'denormalized table' to this repository.
 void addFilterDefinition(FilterDefinition definition)
          Adds a filter definition to this repository.
 void addGenerator(IdGenerator generator)
          Add a generator.
 void addGeneratorTable(String name, Properties params)
          Add a generator table properties.
 void addImport(String entityName, String rename)
          Adds an import (HQL entity rename) to the repository.
 void addJoins(PersistentClass persistentClass, Map<String,Join> joins)
          Add join metadata for a persistent entity.
 void addMappedBy(String entityName, String propertyName, String inversePropertyName)
           
 void addMappedSuperclass(Class type, MappedSuperclass mappedSuperclass)
          add a new MappedSuperclass This should not be called if the MappedSuperclass already exists (it would be erased)
 void addPropertyAnnotatedWithMapsId(org.hibernate.annotations.common.reflection.XClass entityType, PropertyData property)
           
 void addPropertyAnnotatedWithMapsIdSpecj(org.hibernate.annotations.common.reflection.XClass entityType, PropertyData property, String mapsIdValue)
           
 void addPropertyReference(String referencedClass, String propertyName)
          Adds a property reference binding to this repository.
 void addPropertyReferencedAssociation(String entityName, String propertyName, String propertyRef)
           
 void addQuery(String name, NamedQueryDefinition query)
          Adds metadata for a named query to this repository.
 void addResultSetMapping(ResultSetMappingDefinition sqlResultSetMapping)
          Adds the metadata for a named SQL result set mapping to this repository.
 void addSecondPass(SecondPass sp)
          Adds a second-pass to the end of the current queue.
 void addSecondPass(SecondPass sp, boolean onTopOfTheQueue)
          Adds a second pass.
 void addSQLQuery(String name, NamedSQLQueryDefinition query)
          Adds metadata for a named SQL query to this repository.
 Table addTable(String schema, String catalog, String name, String subselect, boolean isAbstract)
          Adds table metadata to this repository returning the created metadata instance.
 void addTableBinding(String schema, String catalog, String logicalName, String physicalName, Table denormalizedSuperTable)
          Adds a table binding to this repository.
 void addToExtendsQueue(ExtendsQueueEntry entry)
          Adds an entry to the extends queue queue.
 void addToOneAndIdProperty(org.hibernate.annotations.common.reflection.XClass entityType, PropertyData property)
           
 void addTypeDef(String typeName, String typeClass, Properties paramMap)
          Adds a type definition to this metadata repository.
 void addUniqueConstraintHolders(Table table, List<UniqueConstraintHolder> uniqueConstraintHolders)
           
 void addUniqueConstraints(Table table, List uniqueConstraints)
           
 void addUniquePropertyReference(String referencedClass, String propertyName)
          Adds a property reference binding to this repository where said proeprty reference is marked as unique.
 void applyResultSetMapping(ResultSetMappingDefinition sqlResultSetMapping)
           
 FetchProfile findOrCreateFetchProfile(String name, MetadataSource source)
          Retrieves a fetch profile by either finding one currently in this repository matching the given name or by creating one (and adding it).
 boolean forceDiscriminatorInSelectsByDefault()
           
 AnyMetaDef getAnyMetaDef(String name)
           
 String getCatalogName()
          Returns the currently bound default catalog name.
 PersistentClass getClass(String entityName)
          Retrieves the entity mapping metadata for the given entity name.
 Map getClasses()
           
 AnnotatedClassType getClassType(org.hibernate.annotations.common.reflection.XClass clazz)
          Get and maintain a cache of class type.
 Collection getCollection(String role)
          Retrieves the collection mapping metadata for the given collection role.
 Properties getConfigurationProperties()
          Retrieve the configuration properties currently in effect.
 String getDefaultAccess()
          Get the current default property access style.
 String getDefaultCascade()
          Get the current default cascade style.
 String getDefaultPackage()
          Get the currently bound default package name.
 FilterDefinition getFilterDefinition(String name)
          Retrieves a filter definition by name.
 Map getFilterDefinitions()
          Retrieves the copmplete map of filter definitions.
 String getFromMappedBy(String entityName, String propertyName)
           
 IdGenerator getGenerator(String name)
          Retrieve the id-generator by name.
 IdGenerator getGenerator(String name, Map<String,IdGenerator> localGenerators)
          Try to find the generator from the localGenerators and then from the global generator list
 Properties getGeneratorTableProperties(String name, Map<String,Properties> localGeneratorTables)
          Retrieve the properties related to a generator table.
 MutableIdentifierGeneratorFactory getIdentifierGeneratorFactory()
          Retrieve the IdentifierGeneratorFactory in effect for this mapping.
 Map<String,Join> getJoins(String entityName)
          Retrieve join metadata for a particular persistent entity.
 String getLogicalColumnName(String physicalName, Table table)
          Find the logical column name against whcih the given physical column name was bound within the given table.
 String getLogicalTableName(Table table)
          Get the logical table name mapped for the given physical table.
 MappedSuperclass getMappedSuperclass(Class type)
          Get a MappedSuperclass or null if not mapped
 NamingStrategy getNamingStrategy()
          Get the current naming strategy.
 NamingStrategyDelegator getNamingStrategyDelegator()
          Get the current naming strategy delegate.
 ObjectNameNormalizer getObjectNameNormalizer()
          Retrieve the database identifier normalizer for this context.
 String getPhysicalColumnName(String logicalName, Table table)
          Find the physical column name for the given logical column name within the given table.
 PropertyData getPropertyAnnotatedWithIdAndToOne(org.hibernate.annotations.common.reflection.XClass entityType, String propertyName)
          Return the property annotated with @ToOne and @Id if any.
 PropertyData getPropertyAnnotatedWithMapsId(org.hibernate.annotations.common.reflection.XClass entityType, String propertyName)
          Return the property annotated with @MapsId("propertyName") if any.
 String getPropertyReferencedAssociation(String entityName, String propertyName)
           
 NamedQueryDefinition getQuery(String name)
          Get named query metadata by name.
 org.hibernate.annotations.common.reflection.ReflectionManager getReflectionManager()
           
 ResultSetMappingDefinition getResultSetMapping(String name)
          Get the metadata for a named SQL result set mapping.
 String getSchemaName()
          Returns the currently bound default schema name.
 NamedSQLQueryDefinition getSQLQuery(String name)
          Get named SQL query metadata.
 Table getTable(String schema, String catalog, String name)
          Returns the named table metadata.
 Map<Table,List<String[]>> getTableUniqueConstraints()
          
 TypeDef getTypeDef(String typeName)
          Retrieve a type definition by name.
 TypeResolver getTypeResolver()
          Retrieve the type resolver in effect.
 Map<Table,List<UniqueConstraintHolder>> getUniqueConstraintHoldersByTable()
           
 boolean ignoreExplicitDiscriminatorColumnForJoinedInheritance()
          Should we ignore explicit DiscriminatorColumn annotations when combined with joined inheritance?
 boolean isAutoImport()
          Determine whether auto importing of entity names is currently enabled.
 boolean isDefaultLazy()
          Determine whether default laziness is currently enabled.
 boolean isInSecondPass()
           
 boolean isSpecjProprietarySyntaxEnabled()
           
 Iterator<AuxiliaryDatabaseObject> iterateAuxiliaryDatabaseObjects()
          Retrieves an iterator over the metadata pertaining to all auxiliary database objects int this repository.
 ListIterator<AuxiliaryDatabaseObject> iterateAuxiliaryDatabaseObjectsInReverse()
          Same as Mappings.iterateAuxiliaryDatabaseObjects() except that here the iterator is reversed.
 Iterator<AuxiliaryDatabaseObject> iterateAuxliaryDatabaseObjects()
           
 ListIterator<AuxiliaryDatabaseObject> iterateAuxliaryDatabaseObjectsInReverse()
           
 Iterator<PersistentClass> iterateClasses()
          Retrieves an iterator over the entity metadata present in this repository.
 Iterator<Collection> iterateCollections()
          Returns an iterator over collection metadata.
 Iterator<Table> iterateTables()
          Returns an iterator over table metadata.
 PersistentClass locatePersistentClassByEntityName(String entityName)
          Retrieves the entity mapping metadata for the given entity name, potentially accounting for imports.
protected  void removeResultSetMapping(String name)
           
 void setAutoImport(boolean autoImport)
          Set whether to enable auto importing of entity names.
 void setCatalogName(String catalogName)
          Sets the currently bound default catalog name.
 void setDefaultAccess(String defaultAccess)
          Sets the current default property access style.
 void setDefaultCascade(String defaultCascade)
          Sets the current default cascade style.
 void setDefaultLazy(boolean defaultLazy)
          Set whether to enable default laziness.
 void setDefaultPackage(String defaultPackage)
          Set the current default package name.
 void setNamingStrategy(NamingStrategy namingStrategy)
          Set the current naming strategy.
 void setNamingStrategyDelegator(NamingStrategyDelegator namingStrategyDelegator)
          Set a current naming strategy delegator.
 void setSchemaName(String schemaName)
          Sets the currently bound default schema name.
 boolean useImplicitDiscriminatorColumnForJoinedInheritance()
          Should we handle absent DiscriminatorColumn mappings for joined inheritance by implicitly mapping a discriminator column?
 boolean useNationalizedCharacterData()
          Should we use nationalized variants of character data by default? This is controlled by the AvailableSettings.USE_NATIONALIZED_CHARACTER_DATA setting.
 boolean useNewGeneratorMappings()
          Should we use the new generator strategy mappings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configuration.MappingsImpl

protected Configuration.MappingsImpl()
Method Detail

getSchemaName

public String getSchemaName()
Description copied from interface: Mappings
Returns the currently bound default schema name.

Specified by:
getSchemaName in interface Mappings
Returns:
The currently bound schema name

setSchemaName

public void setSchemaName(String schemaName)
Description copied from interface: Mappings
Sets the currently bound default schema name.

Specified by:
setSchemaName in interface Mappings
Parameters:
schemaName - The schema name to bind as the current default.

getCatalogName

public String getCatalogName()
Description copied from interface: Mappings
Returns the currently bound default catalog name.

Specified by:
getCatalogName in interface Mappings
Returns:
The currently bound catalog name, or null if none.

setCatalogName

public void setCatalogName(String catalogName)
Description copied from interface: Mappings
Sets the currently bound default catalog name.

Specified by:
setCatalogName in interface Mappings
Parameters:
catalogName - The catalog name to use as the current default.

getDefaultPackage

public String getDefaultPackage()
Description copied from interface: Mappings
Get the currently bound default package name.

Specified by:
getDefaultPackage in interface Mappings
Returns:
The currently bound default package name

setDefaultPackage

public void setDefaultPackage(String defaultPackage)
Description copied from interface: Mappings
Set the current default package name.

Specified by:
setDefaultPackage in interface Mappings
Parameters:
defaultPackage - The package name to set as the current default.

isAutoImport

public boolean isAutoImport()
Description copied from interface: Mappings
Determine whether auto importing of entity names is currently enabled.

Specified by:
isAutoImport in interface Mappings
Returns:
True if currently enabled; false otherwise.

setAutoImport

public void setAutoImport(boolean autoImport)
Description copied from interface: Mappings
Set whether to enable auto importing of entity names.

Specified by:
setAutoImport in interface Mappings
Parameters:
autoImport - True to enable; false to diasable.
See Also:
Mappings.addImport(java.lang.String, java.lang.String)

isDefaultLazy

public boolean isDefaultLazy()
Description copied from interface: Mappings
Determine whether default laziness is currently enabled.

Specified by:
isDefaultLazy in interface Mappings
Returns:
True if enabled, false otherwise.

setDefaultLazy

public void setDefaultLazy(boolean defaultLazy)
Description copied from interface: Mappings
Set whether to enable default laziness.

Specified by:
setDefaultLazy in interface Mappings
Parameters:
defaultLazy - True to enable, false to disable.

getDefaultCascade

public String getDefaultCascade()
Description copied from interface: Mappings
Get the current default cascade style.

Specified by:
getDefaultCascade in interface Mappings
Returns:
The current default cascade style.

setDefaultCascade

public void setDefaultCascade(String defaultCascade)
Description copied from interface: Mappings
Sets the current default cascade style. .

Specified by:
setDefaultCascade in interface Mappings
Parameters:
defaultCascade - The cascade style to set as the current default.

getDefaultAccess

public String getDefaultAccess()
Description copied from interface: Mappings
Get the current default property access style.

Specified by:
getDefaultAccess in interface Mappings
Returns:
The current default property access style.

setDefaultAccess

public void setDefaultAccess(String defaultAccess)
Description copied from interface: Mappings
Sets the current default property access style.

Specified by:
setDefaultAccess in interface Mappings
Parameters:
defaultAccess - The access style to use as the current default.

getNamingStrategy

public NamingStrategy getNamingStrategy()
Description copied from interface: Mappings
Get the current naming strategy.

Specified by:
getNamingStrategy in interface Mappings
Returns:
The current naming strategy.

setNamingStrategy

public void setNamingStrategy(NamingStrategy namingStrategy)
Description copied from interface: Mappings
Set the current naming strategy. An instance of LegacyNamingStrategyDelegator will be constructed with the specified naming strategy.

Specified by:
setNamingStrategy in interface Mappings
Parameters:
namingStrategy - the NamingStrategy to set; must be non-null.
See Also:
LegacyNamingStrategyDelegator.LegacyNamingStrategyDelegator(NamingStrategy)

getNamingStrategyDelegator

public NamingStrategyDelegator getNamingStrategyDelegator()
Description copied from interface: Mappings
Get the current naming strategy delegate.

Specified by:
getNamingStrategyDelegator in interface Mappings
Returns:
The current naming strategy delegate.

setNamingStrategyDelegator

public void setNamingStrategyDelegator(NamingStrategyDelegator namingStrategyDelegator)
Description copied from interface: Mappings
Set a current naming strategy delegator.

Specified by:
setNamingStrategyDelegator in interface Mappings
Parameters:
namingStrategyDelegator - the NamingStrategyDelegator to set; must be non-null; if namingStrategyDelegator is an instance of LegacyNamingStrategyDelegator, then LegacyNamingStrategyDelegator.getNamingStrategy() must be non-null.

getTypeResolver

public TypeResolver getTypeResolver()
Description copied from interface: Mappings
Retrieve the type resolver in effect.

Specified by:
getTypeResolver in interface Mappings
Returns:
The type resolver.

iterateClasses

public Iterator<PersistentClass> iterateClasses()
Description copied from interface: Mappings
Retrieves an iterator over the entity metadata present in this repository.

Specified by:
iterateClasses in interface Mappings
Returns:
Iterator over class metadata.

getClass

public PersistentClass getClass(String entityName)
Description copied from interface: Mappings
Retrieves the entity mapping metadata for the given entity name.

Specified by:
getClass in interface Mappings
Parameters:
entityName - The entity name for which to retrieve the metadata.
Returns:
The entity mapping metadata, or null if none found matching given entity name.

locatePersistentClassByEntityName

public PersistentClass locatePersistentClassByEntityName(String entityName)
Description copied from interface: Mappings
Retrieves the entity mapping metadata for the given entity name, potentially accounting for imports.

Specified by:
locatePersistentClassByEntityName in interface Mappings
Parameters:
entityName - The entity name for which to retrieve the metadata.
Returns:
The entity mapping metadata, or null if none found matching given entity name.

addClass

public void addClass(PersistentClass persistentClass)
              throws DuplicateMappingException
Description copied from interface: Mappings
Add entity mapping metadata.

Specified by:
addClass in interface Mappings
Parameters:
persistentClass - The entity metadata
Throws:
DuplicateMappingException - Indicates there4 was already an extry corresponding to the given entity name.

addImport

public void addImport(String entityName,
                      String rename)
               throws DuplicateMappingException
Description copied from interface: Mappings
Adds an import (HQL entity rename) to the repository.

Specified by:
addImport in interface Mappings
Parameters:
entityName - The entity name being renamed.
rename - The rename
Throws:
DuplicateMappingException - If rename already is mapped to another entity name in this repository.

getCollection

public Collection getCollection(String role)
Description copied from interface: Mappings
Retrieves the collection mapping metadata for the given collection role.

Specified by:
getCollection in interface Mappings
Parameters:
role - The collection role for which to retrieve the metadata.
Returns:
The collection mapping metadata, or null if no matching collection role found.

iterateCollections

public Iterator<Collection> iterateCollections()
Description copied from interface: Mappings
Returns an iterator over collection metadata.

Specified by:
iterateCollections in interface Mappings
Returns:
Iterator over collection metadata.

addCollection

public void addCollection(Collection collection)
                   throws DuplicateMappingException
Description copied from interface: Mappings
Add collection mapping metadata to this repository.

Specified by:
addCollection in interface Mappings
Parameters:
collection - The collection metadata
Throws:
DuplicateMappingException - Indicates there was already an entry corresponding to the given collection role

getTable

public Table getTable(String schema,
                      String catalog,
                      String name)
Description copied from interface: Mappings
Returns the named table metadata.

Specified by:
getTable in interface Mappings
Parameters:
schema - The named schema in which the table belongs (or null).
catalog - The named catalog in which the table belongs (or null).
name - The table name
Returns:
The table metadata, or null.

iterateTables

public Iterator<Table> iterateTables()
Description copied from interface: Mappings
Returns an iterator over table metadata.

Specified by:
iterateTables in interface Mappings
Returns:
Iterator over table metadata.

addTable

public Table addTable(String schema,
                      String catalog,
                      String name,
                      String subselect,
                      boolean isAbstract)
Description copied from interface: Mappings
Adds table metadata to this repository returning the created metadata instance.

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

addDenormalizedTable

public Table addDenormalizedTable(String schema,
                                  String catalog,
                                  String name,
                                  boolean isAbstract,
                                  String subselect,
                                  Table includedTable)
                           throws DuplicateMappingException
Description copied from interface: Mappings
Adds a 'denormalized table' to this repository.

Specified by:
addDenormalizedTable in interface Mappings
Parameters:
schema - The named schema in which the table belongs (or null).
catalog - The named catalog in which the table belongs (or null).
name - The table name
isAbstract - Is the table abstract (i.e. not really existing in the DB)?
subselect - A select statement which defines a logical table, much like a DB view.
includedTable - ???
Returns:
The created table metadata.
Throws:
DuplicateMappingException - If such a table mapping already exists.

getQuery

public NamedQueryDefinition getQuery(String name)
Description copied from interface: Mappings
Get named query metadata by name.

Specified by:
getQuery in interface Mappings
Parameters:
name - The named query name
Returns:
The query metadata, or null.

addQuery

public void addQuery(String name,
                     NamedQueryDefinition query)
              throws DuplicateMappingException
Description copied from interface: Mappings
Adds metadata for a named query to this repository.

Specified by:
addQuery in interface Mappings
Parameters:
name - The name
query - The metadata
Throws:
DuplicateMappingException - If a query already exists with that name.

addDefaultQuery

public void addDefaultQuery(String name,
                            NamedQueryDefinition query)
Specified by:
addDefaultQuery in interface Mappings

getSQLQuery

public NamedSQLQueryDefinition getSQLQuery(String name)
Description copied from interface: Mappings
Get named SQL query metadata.

Specified by:
getSQLQuery in interface Mappings
Parameters:
name - The named SQL query name.
Returns:
The meatdata, or null if none found.

addSQLQuery

public void addSQLQuery(String name,
                        NamedSQLQueryDefinition query)
                 throws DuplicateMappingException
Description copied from interface: Mappings
Adds metadata for a named SQL query to this repository.

Specified by:
addSQLQuery in interface Mappings
Parameters:
name - The name
query - The metadata
Throws:
DuplicateMappingException - If a query already exists with that name.

addDefaultSQLQuery

public void addDefaultSQLQuery(String name,
                               NamedSQLQueryDefinition query)
Specified by:
addDefaultSQLQuery in interface Mappings

getResultSetMapping

public ResultSetMappingDefinition getResultSetMapping(String name)
Description copied from interface: Mappings
Get the metadata for a named SQL result set mapping.

Specified by:
getResultSetMapping in interface Mappings
Parameters:
name - The mapping name.
Returns:
The SQL result set mapping metadat, or null if none found.

addResultSetMapping

public void addResultSetMapping(ResultSetMappingDefinition sqlResultSetMapping)
                         throws DuplicateMappingException
Description copied from interface: Mappings
Adds the metadata for a named SQL result set mapping to this repository.

Specified by:
addResultSetMapping in interface Mappings
Parameters:
sqlResultSetMapping - The metadata
Throws:
DuplicateMappingException - If metadata for another SQL result mapping was already found under the given name.

applyResultSetMapping

public void applyResultSetMapping(ResultSetMappingDefinition sqlResultSetMapping)
                           throws DuplicateMappingException
Throws:
DuplicateMappingException

addDefaultResultSetMapping

public void addDefaultResultSetMapping(ResultSetMappingDefinition definition)
Specified by:
addDefaultResultSetMapping in interface Mappings

removeResultSetMapping

protected void removeResultSetMapping(String name)

getTypeDef

public TypeDef getTypeDef(String typeName)
Description copied from interface: Mappings
Retrieve a type definition by name.

Specified by:
getTypeDef in interface Mappings
Parameters:
typeName - The name of the type definition to retrieve.
Returns:
The type definition, or null if none found.

addTypeDef

public void addTypeDef(String typeName,
                       String typeClass,
                       Properties paramMap)
Description copied from interface: Mappings
Adds a type definition to this metadata repository.

Specified by:
addTypeDef in interface Mappings
Parameters:
typeName - The type name.
typeClass - The class implementing the Type contract.
paramMap - Map of parameters to be used to configure the type after instantiation.

getFilterDefinitions

public Map getFilterDefinitions()
Description copied from interface: Mappings
Retrieves the copmplete map of filter definitions.

Specified by:
getFilterDefinitions in interface Mappings
Returns:
The filter definition map.

getFilterDefinition

public FilterDefinition getFilterDefinition(String name)
Description copied from interface: Mappings
Retrieves a filter definition by name.

Specified by:
getFilterDefinition in interface Mappings
Parameters:
name - The name of the filter definition to retrieve.
Returns:
The filter definition, or null.

addFilterDefinition

public void addFilterDefinition(FilterDefinition definition)
Description copied from interface: Mappings
Adds a filter definition to this repository.

Specified by:
addFilterDefinition in interface Mappings
Parameters:
definition - The filter definition to add.

findOrCreateFetchProfile

public FetchProfile findOrCreateFetchProfile(String name,
                                             MetadataSource source)
Description copied from interface: Mappings
Retrieves a fetch profile by either finding one currently in this repository matching the given name or by creating one (and adding it).

Specified by:
findOrCreateFetchProfile in interface Mappings
Parameters:
name - The name of the profile.
source - The source from which this profile is named.
Returns:
The fetch profile metadata.

iterateAuxliaryDatabaseObjects

public Iterator<AuxiliaryDatabaseObject> iterateAuxliaryDatabaseObjects()
Specified by:
iterateAuxliaryDatabaseObjects in interface Mappings

iterateAuxiliaryDatabaseObjects

public Iterator<AuxiliaryDatabaseObject> iterateAuxiliaryDatabaseObjects()
Description copied from interface: Mappings
Retrieves an iterator over the metadata pertaining to all auxiliary database objects int this repository.

Specified by:
iterateAuxiliaryDatabaseObjects in interface Mappings
Returns:
Iterator over the auxiliary database object metadata.

iterateAuxliaryDatabaseObjectsInReverse

public ListIterator<AuxiliaryDatabaseObject> iterateAuxliaryDatabaseObjectsInReverse()
Specified by:
iterateAuxliaryDatabaseObjectsInReverse in interface Mappings

iterateAuxiliaryDatabaseObjectsInReverse

public ListIterator<AuxiliaryDatabaseObject> iterateAuxiliaryDatabaseObjectsInReverse()
Description copied from interface: Mappings
Same as Mappings.iterateAuxiliaryDatabaseObjects() except that here the iterator is reversed.

Specified by:
iterateAuxiliaryDatabaseObjectsInReverse in interface Mappings
Returns:
The reversed iterator.

addAuxiliaryDatabaseObject

public void addAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject)
Description copied from interface: Mappings
Add metadata pertaining to an auxiliary database object to this repository.

Specified by:
addAuxiliaryDatabaseObject in interface Mappings
Parameters:
auxiliaryDatabaseObject - The metadata.

getLogicalTableName

public String getLogicalTableName(Table table)
                           throws MappingException
Description copied from interface: Mappings
Get the logical table name mapped for the given physical table.

Specified by:
getLogicalTableName in interface Mappings
Parameters:
table - The table for which to determine the logical name.
Returns:
The logical name.
Throws:
MappingException - Indicates that no logical name was bound for the given physical table.

addTableBinding

public void addTableBinding(String schema,
                            String catalog,
                            String logicalName,
                            String physicalName,
                            Table denormalizedSuperTable)
                     throws DuplicateMappingException
Description copied from interface: Mappings
Adds a table binding to this repository.

Specified by:
addTableBinding in interface Mappings
Parameters:
schema - The schema in which the table belongs (may be null).
catalog - The catalog in which the table belongs (may be null).
logicalName - The logical table name.
physicalName - The physical table name.
denormalizedSuperTable - ???
Throws:
DuplicateMappingException - Indicates physical table was already bound to another logical name.

addColumnBinding

public void addColumnBinding(String logicalName,
                             Column physicalColumn,
                             Table table)
                      throws DuplicateMappingException
Description copied from interface: Mappings
Binds the given 'physicalColumn' to the give 'logicalName' within the given 'table'.

Specified by:
addColumnBinding in interface Mappings
Parameters:
logicalName - The logical column name binding.
physicalColumn - The physical column metadata.
table - The table metadata.
Throws:
DuplicateMappingException - Indicates a duplicate binding for either the physical column name or the logical column name.

getPhysicalColumnName

public String getPhysicalColumnName(String logicalName,
                                    Table table)
                             throws MappingException
Description copied from interface: Mappings
Find the physical column name for the given logical column name within the given table.

Specified by:
getPhysicalColumnName in interface Mappings
Parameters:
logicalName - The logical name binding.
table - The table metatdata.
Returns:
The physical column name.
Throws:
MappingException - Indicates that no such binding was found.

getLogicalColumnName

public String getLogicalColumnName(String physicalName,
                                   Table table)
                            throws MappingException
Description copied from interface: Mappings
Find the logical column name against whcih the given physical column name was bound within the given table.

Specified by:
getLogicalColumnName in interface Mappings
Parameters:
physicalName - The physical column name
table - The table metadata.
Returns:
The logical column name.
Throws:
MappingException - Indicates that no such binding was found.

addSecondPass

public void addSecondPass(SecondPass sp)
Description copied from interface: Mappings
Adds a second-pass to the end of the current queue.

Specified by:
addSecondPass in interface Mappings
Parameters:
sp - The second pass to add.

addSecondPass

public void addSecondPass(SecondPass sp,
                          boolean onTopOfTheQueue)
Description copied from interface: Mappings
Adds a second pass.

Specified by:
addSecondPass in interface Mappings
Parameters:
sp - The second pass to add.
onTopOfTheQueue - True to add to the beginning of the queue; false to add to the end.

addPropertyReference

public void addPropertyReference(String referencedClass,
                                 String propertyName)
Description copied from interface: Mappings
Adds a property reference binding to this repository.

Specified by:
addPropertyReference in interface Mappings
Parameters:
referencedClass - The referenced entity name.
propertyName - The referenced property name.

addUniquePropertyReference

public void addUniquePropertyReference(String referencedClass,
                                       String propertyName)
Description copied from interface: Mappings
Adds a property reference binding to this repository where said proeprty reference is marked as unique.

Specified by:
addUniquePropertyReference in interface Mappings
Parameters:
referencedClass - The referenced entity name.
propertyName - The referenced property name.

addToExtendsQueue

public void addToExtendsQueue(ExtendsQueueEntry entry)
Description copied from interface: Mappings
Adds an entry to the extends queue queue.

Specified by:
addToExtendsQueue in interface Mappings
Parameters:
entry - The entry to add.

getIdentifierGeneratorFactory

public MutableIdentifierGeneratorFactory getIdentifierGeneratorFactory()
Description copied from interface: Mappings
Retrieve the IdentifierGeneratorFactory in effect for this mapping.

Specified by:
getIdentifierGeneratorFactory in interface Mappings
Returns:
The IdentifierGeneratorFactory

addMappedSuperclass

public void addMappedSuperclass(Class type,
                                MappedSuperclass mappedSuperclass)
Description copied from interface: Mappings
add a new MappedSuperclass This should not be called if the MappedSuperclass already exists (it would be erased)

Specified by:
addMappedSuperclass in interface Mappings
Parameters:
type - type corresponding to the Mappedsuperclass
mappedSuperclass - MappedSuperclass

getMappedSuperclass

public MappedSuperclass getMappedSuperclass(Class type)
Description copied from interface: Mappings
Get a MappedSuperclass or null if not mapped

Specified by:
getMappedSuperclass in interface Mappings
Parameters:
type - class corresponding to the MappedSuperclass
Returns:
the MappedSuperclass

getObjectNameNormalizer

public ObjectNameNormalizer getObjectNameNormalizer()
Description copied from interface: Mappings
Retrieve the database identifier normalizer for this context.

Specified by:
getObjectNameNormalizer in interface Mappings
Returns:
The normalizer.

getConfigurationProperties

public Properties getConfigurationProperties()
Description copied from interface: Mappings
Retrieve the configuration properties currently in effect.

Specified by:
getConfigurationProperties in interface Mappings
Returns:
The configuration properties

addDefaultGenerator

public void addDefaultGenerator(IdGenerator generator)
Description copied from interface: Mappings
Adds a default id generator.

Specified by:
addDefaultGenerator in interface Mappings
Parameters:
generator - The id generator

isInSecondPass

public boolean isInSecondPass()
Specified by:
isInSecondPass in interface Mappings

getPropertyAnnotatedWithMapsId

public PropertyData getPropertyAnnotatedWithMapsId(org.hibernate.annotations.common.reflection.XClass entityType,
                                                   String propertyName)
Description copied from interface: Mappings
Return the property annotated with @MapsId("propertyName") if any. Null otherwise

Specified by:
getPropertyAnnotatedWithMapsId in interface Mappings

addPropertyAnnotatedWithMapsId

public void addPropertyAnnotatedWithMapsId(org.hibernate.annotations.common.reflection.XClass entityType,
                                           PropertyData property)
Specified by:
addPropertyAnnotatedWithMapsId in interface Mappings

isSpecjProprietarySyntaxEnabled

public boolean isSpecjProprietarySyntaxEnabled()
Specified by:
isSpecjProprietarySyntaxEnabled in interface Mappings

addPropertyAnnotatedWithMapsIdSpecj

public void addPropertyAnnotatedWithMapsIdSpecj(org.hibernate.annotations.common.reflection.XClass entityType,
                                                PropertyData property,
                                                String mapsIdValue)
Specified by:
addPropertyAnnotatedWithMapsIdSpecj in interface Mappings

getPropertyAnnotatedWithIdAndToOne

public PropertyData getPropertyAnnotatedWithIdAndToOne(org.hibernate.annotations.common.reflection.XClass entityType,
                                                       String propertyName)
Description copied from interface: Mappings
Return the property annotated with @ToOne and @Id if any. Null otherwise

Specified by:
getPropertyAnnotatedWithIdAndToOne in interface Mappings

addToOneAndIdProperty

public void addToOneAndIdProperty(org.hibernate.annotations.common.reflection.XClass entityType,
                                  PropertyData property)
Specified by:
addToOneAndIdProperty in interface Mappings

useNewGeneratorMappings

public boolean useNewGeneratorMappings()
Description copied from interface: Mappings
Should we use the new generator strategy mappings. This is controlled by the AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS setting.

Specified by:
useNewGeneratorMappings in interface Mappings
Returns:
True if the new generators should be used, false otherwise.

useImplicitDiscriminatorColumnForJoinedInheritance

public boolean useImplicitDiscriminatorColumnForJoinedInheritance()
Description copied from interface: Mappings
Should we handle absent DiscriminatorColumn mappings for joined inheritance by implicitly mapping a discriminator column?

Specified by:
useImplicitDiscriminatorColumnForJoinedInheritance in interface Mappings
Returns:
true indicates we should infer DiscriminatorColumn implicitly (aka, map to a discriminator column even without a DiscriminatorColumn annotation); false (the default) indicates that we should not.
See Also:
AvailableSettings.IMPLICIT_DISCRIMINATOR_COLUMNS_FOR_JOINED_SUBCLASS

ignoreExplicitDiscriminatorColumnForJoinedInheritance

public boolean ignoreExplicitDiscriminatorColumnForJoinedInheritance()
Description copied from interface: Mappings
Should we ignore explicit DiscriminatorColumn annotations when combined with joined inheritance?

Specified by:
ignoreExplicitDiscriminatorColumnForJoinedInheritance in interface Mappings
Returns:
true indicates we should ignore explicit DiscriminatorColumn annotations; false (the default) indicates we should not ignore them
See Also:
AvailableSettings.IGNORE_EXPLICIT_DISCRIMINATOR_COLUMNS_FOR_JOINED_SUBCLASS

useNationalizedCharacterData

public boolean useNationalizedCharacterData()
Description copied from interface: Mappings
Should we use nationalized variants of character data by default? This is controlled by the AvailableSettings.USE_NATIONALIZED_CHARACTER_DATA setting.

Specified by:
useNationalizedCharacterData in interface Mappings
Returns:
true if nationalized character data should be used by default; false otherwise.

forceDiscriminatorInSelectsByDefault

public boolean forceDiscriminatorInSelectsByDefault()
Specified by:
forceDiscriminatorInSelectsByDefault in interface Mappings

getGenerator

public IdGenerator getGenerator(String name)
Description copied from interface: Mappings
Retrieve the id-generator by name.

Specified by:
getGenerator in interface Mappings
Parameters:
name - The generator name.
Returns:
The generator, or null.

getGenerator

public IdGenerator getGenerator(String name,
                                Map<String,IdGenerator> localGenerators)
Description copied from interface: Mappings
Try to find the generator from the localGenerators and then from the global generator list

Specified by:
getGenerator in interface Mappings
Parameters:
name - generator name
localGenerators - local generators
Returns:
the appropriate idgenerator or null if not found

addGenerator

public void addGenerator(IdGenerator generator)
Description copied from interface: Mappings
Add a generator.

Specified by:
addGenerator in interface Mappings
Parameters:
generator - The generator to add.

addGeneratorTable

public void addGeneratorTable(String name,
                              Properties params)
Description copied from interface: Mappings
Add a generator table properties.

Specified by:
addGeneratorTable in interface Mappings
Parameters:
name - The generator name
params - The generator table properties.

getGeneratorTableProperties

public Properties getGeneratorTableProperties(String name,
                                              Map<String,Properties> localGeneratorTables)
Description copied from interface: Mappings
Retrieve the properties related to a generator table.

Specified by:
getGeneratorTableProperties in interface Mappings
Parameters:
name - generator name
localGeneratorTables - local generator tables
Returns:
The properties, or null.

getJoins

public Map<String,Join> getJoins(String entityName)
Description copied from interface: Mappings
Retrieve join metadata for a particular persistent entity.

Specified by:
getJoins in interface Mappings
Parameters:
entityName - The entity name
Returns:
The join metadata

addJoins

public void addJoins(PersistentClass persistentClass,
                     Map<String,Join> joins)
Description copied from interface: Mappings
Add join metadata for a persistent entity.

Specified by:
addJoins in interface Mappings
Parameters:
persistentClass - The persistent entity metadata.
joins - The join metadata to add.

getClassType

public AnnotatedClassType getClassType(org.hibernate.annotations.common.reflection.XClass clazz)
Description copied from interface: Mappings
Get and maintain a cache of class type.

Specified by:
getClassType in interface Mappings
Parameters:
clazz - The XClass mapping
Returns:
The class type.

addClassType

public AnnotatedClassType addClassType(org.hibernate.annotations.common.reflection.XClass clazz)
Description copied from interface: Mappings
FIXME should be private but will this break things? Add a class type.

Specified by:
addClassType in interface Mappings
Parameters:
clazz - The XClass mapping.
Returns:
The class type.

getTableUniqueConstraints

public Map<Table,List<String[]>> getTableUniqueConstraints()

Specified by:
getTableUniqueConstraints in interface Mappings

getUniqueConstraintHoldersByTable

public Map<Table,List<UniqueConstraintHolder>> getUniqueConstraintHoldersByTable()
Specified by:
getUniqueConstraintHoldersByTable in interface Mappings

addUniqueConstraints

public void addUniqueConstraints(Table table,
                                 List uniqueConstraints)
Specified by:
addUniqueConstraints in interface Mappings

addUniqueConstraintHolders

public void addUniqueConstraintHolders(Table table,
                                       List<UniqueConstraintHolder> uniqueConstraintHolders)
Specified by:
addUniqueConstraintHolders in interface Mappings

addMappedBy

public void addMappedBy(String entityName,
                        String propertyName,
                        String inversePropertyName)
Specified by:
addMappedBy in interface Mappings

getFromMappedBy

public String getFromMappedBy(String entityName,
                              String propertyName)
Specified by:
getFromMappedBy in interface Mappings

addPropertyReferencedAssociation

public void addPropertyReferencedAssociation(String entityName,
                                             String propertyName,
                                             String propertyRef)
Specified by:
addPropertyReferencedAssociation in interface Mappings

getPropertyReferencedAssociation

public String getPropertyReferencedAssociation(String entityName,
                                               String propertyName)
Specified by:
getPropertyReferencedAssociation in interface Mappings

getReflectionManager

public org.hibernate.annotations.common.reflection.ReflectionManager getReflectionManager()
Specified by:
getReflectionManager in interface Mappings

getClasses

public Map getClasses()
Specified by:
getClasses in interface Mappings

addAnyMetaDef

public void addAnyMetaDef(AnyMetaDef defAnn)
                   throws AnnotationException
Specified by:
addAnyMetaDef in interface Mappings
Throws:
AnnotationException

getAnyMetaDef

public AnyMetaDef getAnyMetaDef(String name)
Specified by:
getAnyMetaDef in interface Mappings


Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.