|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.cfg.Configuration.MappingsImpl
protected class Configuration.MappingsImpl
Internal implementation of the Mappings interface giving access to the Configuration's internal
metadata repository state (Configuration.classes, Configuration.tables, etc).
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.hibernate.cfg.Mappings |
|---|
Mappings.PropertyReference |
| Constructor Summary | |
|---|---|
protected |
Configuration.MappingsImpl()
|
| Method Summary | |
|---|---|
void |
addAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject)
Add metadata pertaining to an auxilary database object to this repository. |
void |
addClass(PersistentClass persistentClass)
Add entity mapping metadata. |
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'. |
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 |
addImport(String entityName,
String rename)
Adds an import (HQL entity rename) to the repository. |
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 |
addPropertyReference(String referencedClass,
String propertyName)
Adds a property reference binding to this repository. |
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 metedata 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 |
addTypeDef(String typeName,
String typeClass,
Properties paramMap)
Adds a type definition to this metadata repository. |
void |
addUniquePropertyReference(String referencedClass,
String propertyName)
Adds a property reference binding to this repository where said proeprty reference is marked as unique. |
FetchProfile |
findOrCreateFetchProfile(String name)
Retrieves a fetch profile by either finding one currently in this repository matching the given name or by creating one (and adding it). |
String |
getCatalogName()
Returns the currently bound default catalog name. |
PersistentClass |
getClass(String entityName)
Retrieves the entity mapping metadata for the given entity name. |
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. |
DefaultIdentifierGeneratorFactory |
getIdentifierGeneratorFactory()
Retrieve the IdentifierGeneratorFactory in effect for this mapping. |
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. |
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. |
NamedQueryDefinition |
getQuery(String name)
Get named query metadata by name. |
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. |
TypeDef |
getTypeDef(String typeName)
Retrieve a type definition by name. |
boolean |
isAutoImport()
Determine whether auto importing of entity names is currently enabled. |
boolean |
isDefaultLazy()
Determine whether default laziness is currently enabled. |
Iterator |
iterateAuxliaryDatabaseObjects()
Retrieves an iterator over the metadata pertaining to all auxilary database objects int this repository. |
ListIterator |
iterateAuxliaryDatabaseObjectsInReverse()
Same as Mappings.iterateAuxliaryDatabaseObjects() except that here the iterator is reversed. |
Iterator |
iterateClasses()
Retrieves an iterator over the entity metadata present in this repository. |
Iterator |
iterateCollections()
Returns an iterator over collection metadata. |
Iterator |
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 |
setSchemaName(String schemaName)
Sets the currently bound default schema name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected Configuration.MappingsImpl()
| Method Detail |
|---|
public String getSchemaName()
Mappings
getSchemaName in interface Mappingspublic void setSchemaName(String schemaName)
Mappings
setSchemaName in interface MappingsschemaName - The schema name to bind as the current default.public String getCatalogName()
Mappings
getCatalogName in interface Mappingspublic void setCatalogName(String catalogName)
Mappings
setCatalogName in interface MappingscatalogName - The catalog name to use as the current default.public String getDefaultPackage()
Mappings
getDefaultPackage in interface Mappingspublic void setDefaultPackage(String defaultPackage)
Mappings
setDefaultPackage in interface MappingsdefaultPackage - The package name to set as the current default.public boolean isAutoImport()
Mappings
isAutoImport in interface Mappingspublic void setAutoImport(boolean autoImport)
Mappings
setAutoImport in interface MappingsautoImport - True to enable; false to diasable.Mappings.addImport(java.lang.String, java.lang.String)public boolean isDefaultLazy()
Mappings
isDefaultLazy in interface Mappingspublic void setDefaultLazy(boolean defaultLazy)
Mappings
setDefaultLazy in interface MappingsdefaultLazy - True to enable, false to disable.public String getDefaultCascade()
Mappings
getDefaultCascade in interface Mappingspublic void setDefaultCascade(String defaultCascade)
Mappings
setDefaultCascade in interface MappingsdefaultCascade - The cascade style to set as the current default.public String getDefaultAccess()
Mappings
getDefaultAccess in interface Mappingspublic void setDefaultAccess(String defaultAccess)
Mappings
setDefaultAccess in interface MappingsdefaultAccess - The access style to use as the current default.public NamingStrategy getNamingStrategy()
Mappings
getNamingStrategy in interface Mappingspublic void setNamingStrategy(NamingStrategy namingStrategy)
Mappings
setNamingStrategy in interface MappingsnamingStrategy - The naming strategy to use.public Iterator iterateClasses()
Mappings
iterateClasses in interface Mappingspublic PersistentClass getClass(String entityName)
Mappings
getClass in interface MappingsentityName - The entity name for which to retrieve the metadata.
public PersistentClass locatePersistentClassByEntityName(String entityName)
Mappings
locatePersistentClassByEntityName in interface MappingsentityName - The entity name for which to retrieve the metadata.
public void addClass(PersistentClass persistentClass)
throws DuplicateMappingException
Mappings
addClass in interface MappingspersistentClass - The entity metadata
DuplicateMappingException - Indicates there4 was already an extry
corresponding to the given entity name.
public void addImport(String entityName,
String rename)
throws DuplicateMappingException
Mappings
addImport in interface MappingsentityName - The entity name being renamed.rename - The rename
DuplicateMappingException - If rename already is mapped to another
entity name in this repository.public Collection getCollection(String role)
Mappings
getCollection in interface Mappingsrole - The collection role for which to retrieve the metadata.
public Iterator iterateCollections()
Mappings
iterateCollections in interface Mappings
public void addCollection(Collection collection)
throws DuplicateMappingException
Mappings
addCollection in interface Mappingscollection - The collection metadata
DuplicateMappingException - Indicates there was already an entry
corresponding to the given collection role
public Table getTable(String schema,
String catalog,
String name)
Mappings
getTable in interface Mappingsschema - 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
public Iterator iterateTables()
Mappings
iterateTables in interface Mappings
public Table addTable(String schema,
String catalog,
String name,
String subselect,
boolean isAbstract)
Mappings
addTable in interface Mappingsschema - The named schema in which the table belongs (or null).catalog - The named catalog in which the table belongs (or null).name - The table namesubselect - A select statement wwich defines a logical table, much
like a DB view.isAbstract - Is the table abstract (i.e. not really existing in the DB)?
public Table addDenormalizedTable(String schema,
String catalog,
String name,
boolean isAbstract,
String subselect,
Table includedTable)
throws DuplicateMappingException
Mappings
addDenormalizedTable in interface Mappingsschema - The named schema in which the table belongs (or null).catalog - The named catalog in which the table belongs (or null).name - The table nameisAbstract - Is the table abstract (i.e. not really existing in the DB)?subselect - A select statement wwich defines a logical table, much
like a DB view.includedTable - ???
DuplicateMappingException - If such a table mapping already exists.public NamedQueryDefinition getQuery(String name)
Mappings
getQuery in interface Mappingsname - The named query name
public void addQuery(String name,
NamedQueryDefinition query)
throws DuplicateMappingException
Mappings
addQuery in interface Mappingsname - The namequery - The metadata
DuplicateMappingException - If a query already exists with that name.public NamedSQLQueryDefinition getSQLQuery(String name)
Mappings
getSQLQuery in interface Mappingsname - The named SQL query name.
public void addSQLQuery(String name,
NamedSQLQueryDefinition query)
throws DuplicateMappingException
Mappings
addSQLQuery in interface Mappingsname - The namequery - The metadata
DuplicateMappingException - If a query already exists with that name.public ResultSetMappingDefinition getResultSetMapping(String name)
Mappings
getResultSetMapping in interface Mappingsname - The mapping name.
public void addResultSetMapping(ResultSetMappingDefinition sqlResultSetMapping)
throws DuplicateMappingException
Mappings
addResultSetMapping in interface MappingssqlResultSetMapping - The metadata
DuplicateMappingException - If metadata for another SQL result mapping was
already found under the given name.protected void removeResultSetMapping(String name)
public TypeDef getTypeDef(String typeName)
Mappings
getTypeDef in interface MappingstypeName - The name of the type definition to retrieve.
public void addTypeDef(String typeName,
String typeClass,
Properties paramMap)
Mappings
addTypeDef in interface MappingstypeName - The type name.typeClass - The class implementing the Type contract.paramMap - Map of parameters to be used to configure the type after instantiation.public Map getFilterDefinitions()
Mappings
getFilterDefinitions in interface Mappingspublic FilterDefinition getFilterDefinition(String name)
Mappings
getFilterDefinition in interface Mappingsname - The name of the filter defintion to retrieve.
public void addFilterDefinition(FilterDefinition definition)
Mappings
addFilterDefinition in interface Mappingsdefinition - The filter definition to add.public FetchProfile findOrCreateFetchProfile(String name)
Mappings
findOrCreateFetchProfile in interface Mappingsname - The name of the profile.
public Iterator iterateAuxliaryDatabaseObjects()
Mappings
iterateAuxliaryDatabaseObjects in interface Mappingspublic ListIterator iterateAuxliaryDatabaseObjectsInReverse()
MappingsMappings.iterateAuxliaryDatabaseObjects() except that here the iterator is reversed.
iterateAuxliaryDatabaseObjectsInReverse in interface Mappingspublic void addAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject)
Mappings
addAuxiliaryDatabaseObject in interface MappingsauxiliaryDatabaseObject - The metadata.
public String getLogicalTableName(Table table)
throws MappingException
Mappings
getLogicalTableName in interface Mappingstable - The table for which to determine the logical name.
MappingException - Indicates that no logical name was bound for the given physical table.
public void addTableBinding(String schema,
String catalog,
String logicalName,
String physicalName,
Table denormalizedSuperTable)
throws DuplicateMappingException
Mappings
addTableBinding in interface Mappingsschema - 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 - ???
DuplicateMappingException - Indicates physical table was already bound to another logical name.
public void addColumnBinding(String logicalName,
Column physicalColumn,
Table table)
throws DuplicateMappingException
Mappings
addColumnBinding in interface MappingslogicalName - The logical column name binding.physicalColumn - The physical column metadata.table - The table metadata.
DuplicateMappingException - Indicates a duplicate binding for either the physical column name
or the logical column name.
public String getPhysicalColumnName(String logicalName,
Table table)
throws MappingException
Mappings
getPhysicalColumnName in interface MappingslogicalName - The logical name binding.table - The table metatdata.
MappingException - Indicates that no such binding was found.
public String getLogicalColumnName(String physicalName,
Table table)
throws MappingException
Mappings
getLogicalColumnName in interface MappingsphysicalName - The physical column nametable - The table metadata.
MappingException - Indicates that no such binding was found.public void addSecondPass(SecondPass sp)
Mappings
addSecondPass in interface Mappingssp - The second pass to add.
public void addSecondPass(SecondPass sp,
boolean onTopOfTheQueue)
Mappings
addSecondPass in interface Mappingssp - The second pass to add.onTopOfTheQueue - True to add to the beginning of the queue; false to add to the end.
public void addPropertyReference(String referencedClass,
String propertyName)
Mappings
addPropertyReference in interface MappingsreferencedClass - The referenced entity name.propertyName - The referenced property name.
public void addUniquePropertyReference(String referencedClass,
String propertyName)
Mappings
addUniquePropertyReference in interface MappingsreferencedClass - The referenced entity name.propertyName - The referenced property name.public void addToExtendsQueue(ExtendsQueueEntry entry)
Mappings
addToExtendsQueue in interface Mappingsentry - The entry to add.public DefaultIdentifierGeneratorFactory getIdentifierGeneratorFactory()
Mappings
getIdentifierGeneratorFactory in interface Mappings
public void addMappedSuperclass(Class type,
MappedSuperclass mappedSuperclass)
Mappings
addMappedSuperclass in interface Mappingstype - type corresponding to the MappedsuperclassmappedSuperclass - MappedSuperclasspublic MappedSuperclass getMappedSuperclass(Class type)
Mappings
getMappedSuperclass in interface Mappingstype - class corresponding to the MappedSuperclass
public ObjectNameNormalizer getObjectNameNormalizer()
Mappings
getObjectNameNormalizer in interface Mappingspublic Properties getConfigurationProperties()
Mappings
getConfigurationProperties in interface Mappings
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||