public interface Mappings
Modifier and Type | Interface and Description |
---|---|
static class |
Mappings.PropertyReference
Represents a property-ref mapping.
|
Modifier and Type | Method and Description |
---|---|
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(java.lang.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(java.lang.String name,
NamedQueryDefinition query) |
void |
addDefaultResultSetMapping(ResultSetMappingDefinition definition) |
void |
addDefaultSQLQuery(java.lang.String name,
NamedSQLQueryDefinition query) |
Table |
addDenormalizedTable(java.lang.String schema,
java.lang.String catalog,
java.lang.String name,
boolean isAbstract,
java.lang.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(java.lang.String name,
java.util.Properties params)
Add a generator table properties.
|
void |
addImport(java.lang.String entityName,
java.lang.String rename)
Adds an import (HQL entity rename) to the repository.
|
void |
addJoins(PersistentClass persistentClass,
java.util.Map<java.lang.String,Join> joins)
Add join metadata for a persistent entity.
|
void |
addMappedBy(java.lang.String entityName,
java.lang.String propertyName,
java.lang.String inversePropertyName) |
void |
addMappedSuperclass(java.lang.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,
java.lang.String mapsIdValue) |
void |
addPropertyReference(java.lang.String referencedClass,
java.lang.String propertyName)
Adds a property reference binding to this repository.
|
void |
addPropertyReferencedAssociation(java.lang.String entityName,
java.lang.String propertyName,
java.lang.String propertyRef) |
void |
addQuery(java.lang.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(java.lang.String name,
NamedSQLQueryDefinition query)
Adds metadata for a named SQL query to this repository.
|
Table |
addTable(java.lang.String schema,
java.lang.String catalog,
java.lang.String name,
java.lang.String subselect,
boolean isAbstract)
Adds table metadata to this repository returning the created
metadata instance.
|
void |
addTableBinding(java.lang.String schema,
java.lang.String catalog,
java.lang.String logicalName,
java.lang.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 entity,
PropertyData property) |
void |
addTypeDef(java.lang.String typeName,
java.lang.String typeClass,
java.util.Properties paramMap)
Adds a type definition to this metadata repository.
|
void |
addUniqueConstraintHolders(Table table,
java.util.List<UniqueConstraintHolder> uniqueConstraintHolders) |
void |
addUniqueConstraints(Table table,
java.util.List uniqueConstraints)
|
void |
addUniquePropertyReference(java.lang.String referencedClass,
java.lang.String propertyName)
Adds a property reference binding to this repository where said proeprty reference is marked as unique.
|
FetchProfile |
findOrCreateFetchProfile(java.lang.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).
|
AnyMetaDef |
getAnyMetaDef(java.lang.String name) |
java.lang.String |
getCatalogName()
Returns the currently bound default catalog name.
|
PersistentClass |
getClass(java.lang.String entityName)
Retrieves the entity mapping metadata for the given entity name.
|
java.util.Map |
getClasses() |
AnnotatedClassType |
getClassType(org.hibernate.annotations.common.reflection.XClass clazz)
Get and maintain a cache of class type.
|
Collection |
getCollection(java.lang.String role)
Retrieves the collection mapping metadata for the given collection role.
|
java.util.Properties |
getConfigurationProperties()
Retrieve the configuration properties currently in effect.
|
java.lang.String |
getDefaultAccess()
Get the current default property access style.
|
java.lang.String |
getDefaultCascade()
Get the current default cascade style.
|
java.lang.String |
getDefaultPackage()
Get the currently bound default package name.
|
FilterDefinition |
getFilterDefinition(java.lang.String name)
Retrieves a filter definition by name.
|
java.util.Map |
getFilterDefinitions()
Retrieves the copmplete map of filter definitions.
|
java.lang.String |
getFromMappedBy(java.lang.String entityName,
java.lang.String propertyName) |
IdGenerator |
getGenerator(java.lang.String name)
Retrieve the id-generator by name.
|
IdGenerator |
getGenerator(java.lang.String name,
java.util.Map<java.lang.String,IdGenerator> localGenerators)
Try to find the generator from the localGenerators
and then from the global generator list
|
java.util.Properties |
getGeneratorTableProperties(java.lang.String name,
java.util.Map<java.lang.String,java.util.Properties> localGeneratorTables)
Retrieve the properties related to a generator table.
|
DefaultIdentifierGeneratorFactory |
getIdentifierGeneratorFactory()
Retrieve the IdentifierGeneratorFactory in effect for this mapping.
|
java.util.Map<java.lang.String,Join> |
getJoins(java.lang.String entityName)
Retrieve join metadata for a particular persistent entity.
|
java.lang.String |
getLogicalColumnName(java.lang.String physicalName,
Table table)
Find the logical column name against whcih the given physical column name was bound within the given table.
|
java.lang.String |
getLogicalTableName(Table table)
Get the logical table name mapped for the given physical table.
|
MappedSuperclass |
getMappedSuperclass(java.lang.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.
|
PersisterClassProvider |
getPersisterClassProvider()
Get the current persister class provider implementation
|
java.lang.String |
getPhysicalColumnName(java.lang.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,
java.lang.String propertyName)
Return the property annotated with @ToOne and @Id if any.
|
PropertyData |
getPropertyAnnotatedWithMapsId(org.hibernate.annotations.common.reflection.XClass entityType,
java.lang.String propertyName)
Return the property annotated with @MapsId("propertyName") if any.
|
java.lang.String |
getPropertyReferencedAssociation(java.lang.String entityName,
java.lang.String propertyName) |
NamedQueryDefinition |
getQuery(java.lang.String name)
Get named query metadata by name.
|
org.hibernate.annotations.common.reflection.ReflectionManager |
getReflectionManager() |
ResultSetMappingDefinition |
getResultSetMapping(java.lang.String name)
Get the metadata for a named SQL result set mapping.
|
java.lang.String |
getSchemaName()
Returns the currently bound default schema name.
|
NamedSQLQueryDefinition |
getSQLQuery(java.lang.String name)
Get named SQL query metadata.
|
Table |
getTable(java.lang.String schema,
java.lang.String catalog,
java.lang.String name)
Returns the named table metadata.
|
java.util.Map<Table,java.util.List<java.lang.String[]>> |
getTableUniqueConstraints()
Deprecated.
Use
getUniqueConstraintHoldersByTable() instead |
TypeDef |
getTypeDef(java.lang.String typeName)
Retrieve a type definition by name.
|
TypeResolver |
getTypeResolver()
Retrieve the type resolver in effect.
|
java.util.Map<Table,java.util.List<UniqueConstraintHolder>> |
getUniqueConstraintHoldersByTable() |
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() |
java.util.Iterator<AuxiliaryDatabaseObject> |
iterateAuxiliaryDatabaseObjects()
Retrieves an iterator over the metadata pertaining to all auxiliary database objects int this repository.
|
java.util.ListIterator<AuxiliaryDatabaseObject> |
iterateAuxiliaryDatabaseObjectsInReverse()
Same as
iterateAuxiliaryDatabaseObjects() except that here the iterator is reversed. |
java.util.Iterator<AuxiliaryDatabaseObject> |
iterateAuxliaryDatabaseObjects()
Deprecated.
To fix misspelling; use
iterateAuxiliaryDatabaseObjects() instead |
java.util.ListIterator<AuxiliaryDatabaseObject> |
iterateAuxliaryDatabaseObjectsInReverse()
Deprecated.
To fix misspelling; use
iterateAuxiliaryDatabaseObjectsInReverse() instead |
java.util.Iterator<PersistentClass> |
iterateClasses()
Retrieves an iterator over the entity metadata present in this repository.
|
java.util.Iterator<Collection> |
iterateCollections()
Returns an iterator over collection metadata.
|
java.util.Iterator<Table> |
iterateTables()
Returns an iterator over table metadata.
|
PersistentClass |
locatePersistentClassByEntityName(java.lang.String entityName)
Retrieves the entity mapping metadata for the given entity name, potentially accounting
for imports.
|
void |
setAutoImport(boolean autoImport)
Set whether to enable auto importing of entity names.
|
void |
setCatalogName(java.lang.String catalogName)
Sets the currently bound default catalog name.
|
void |
setDefaultAccess(java.lang.String defaultAccess)
Sets the current default property access style.
|
void |
setDefaultCascade(java.lang.String defaultCascade)
Sets the current default cascade style.
|
void |
setDefaultLazy(boolean defaultLazy)
Set whether to enable default laziness.
|
void |
setDefaultPackage(java.lang.String defaultPackage)
Set the current default package name.
|
void |
setNamingStrategy(NamingStrategy namingStrategy)
Set the current naming strategy.
|
void |
setPersisterClassProvider(PersisterClassProvider persisterClassProvider)
Set the current persister class provider implementation
|
void |
setSchemaName(java.lang.String schemaName)
Sets the currently bound default schema name.
|
boolean |
useNewGeneratorMappings()
Should we use the new generator strategy mappings.
|
TypeResolver getTypeResolver()
NamingStrategy getNamingStrategy()
void setNamingStrategy(NamingStrategy namingStrategy)
namingStrategy
- The naming strategy to use.PersisterClassProvider getPersisterClassProvider()
void setPersisterClassProvider(PersisterClassProvider persisterClassProvider)
java.lang.String getSchemaName()
void setSchemaName(java.lang.String schemaName)
schemaName
- The schema name to bind as the current default.java.lang.String getCatalogName()
void setCatalogName(java.lang.String catalogName)
catalogName
- The catalog name to use as the current default.java.lang.String getDefaultPackage()
void setDefaultPackage(java.lang.String defaultPackage)
defaultPackage
- The package name to set as the current default.boolean isAutoImport()
void setAutoImport(boolean autoImport)
autoImport
- True to enable; false to diasable.addImport(java.lang.String, java.lang.String)
boolean isDefaultLazy()
void setDefaultLazy(boolean defaultLazy)
defaultLazy
- True to enable, false to disable.java.lang.String getDefaultCascade()
void setDefaultCascade(java.lang.String defaultCascade)
defaultCascade
- The cascade style to set as the current default.java.lang.String getDefaultAccess()
void setDefaultAccess(java.lang.String defaultAccess)
defaultAccess
- The access style to use as the current default.java.util.Iterator<PersistentClass> iterateClasses()
PersistentClass getClass(java.lang.String entityName)
entityName
- The entity name for which to retrieve the metadata.PersistentClass locatePersistentClassByEntityName(java.lang.String entityName)
entityName
- The entity name for which to retrieve the metadata.void addClass(PersistentClass persistentClass) throws DuplicateMappingException
persistentClass
- The entity metadataDuplicateMappingException
- Indicates there4 was already an extry
corresponding to the given entity name.void addImport(java.lang.String entityName, java.lang.String rename) throws DuplicateMappingException
entityName
- The entity name being renamed.rename
- The renameDuplicateMappingException
- If rename already is mapped to another
entity name in this repository.Collection getCollection(java.lang.String role)
role
- The collection role for which to retrieve the metadata.java.util.Iterator<Collection> iterateCollections()
void addCollection(Collection collection) throws DuplicateMappingException
collection
- The collection metadataDuplicateMappingException
- Indicates there was already an entry
corresponding to the given collection roleTable getTable(java.lang.String schema, java.lang.String catalog, java.lang.String name)
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 namejava.util.Iterator<Table> iterateTables()
Table addTable(java.lang.String schema, java.lang.String catalog, java.lang.String name, java.lang.String subselect, boolean isAbstract)
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 namesubselect
- 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)?Table addDenormalizedTable(java.lang.String schema, java.lang.String catalog, java.lang.String name, boolean isAbstract, java.lang.String subselect, Table includedTable) throws DuplicateMappingException
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 nameisAbstract
- 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
- ???DuplicateMappingException
- If such a table mapping already exists.NamedQueryDefinition getQuery(java.lang.String name)
name
- The named query namevoid addQuery(java.lang.String name, NamedQueryDefinition query) throws DuplicateMappingException
name
- The namequery
- The metadataDuplicateMappingException
- If a query already exists with that name.NamedSQLQueryDefinition getSQLQuery(java.lang.String name)
name
- The named SQL query name.void addSQLQuery(java.lang.String name, NamedSQLQueryDefinition query) throws DuplicateMappingException
name
- The namequery
- The metadataDuplicateMappingException
- If a query already exists with that name.ResultSetMappingDefinition getResultSetMapping(java.lang.String name)
name
- The mapping name.void addResultSetMapping(ResultSetMappingDefinition sqlResultSetMapping) throws DuplicateMappingException
sqlResultSetMapping
- The metadataDuplicateMappingException
- If metadata for another SQL result mapping was
already found under the given name.TypeDef getTypeDef(java.lang.String typeName)
typeName
- The name of the type definition to retrieve.void addTypeDef(java.lang.String typeName, java.lang.String typeClass, java.util.Properties paramMap)
typeName
- The type name.typeClass
- The class implementing the Type
contract.paramMap
- Map of parameters to be used to configure the type after instantiation.java.util.Map getFilterDefinitions()
FilterDefinition getFilterDefinition(java.lang.String name)
name
- The name of the filter definition to retrieve.void addFilterDefinition(FilterDefinition definition)
definition
- The filter definition to add.FetchProfile findOrCreateFetchProfile(java.lang.String name, MetadataSource source)
name
- The name of the profile.source
- The source from which this profile is named.@Deprecated java.util.Iterator<AuxiliaryDatabaseObject> iterateAuxliaryDatabaseObjects()
iterateAuxiliaryDatabaseObjects()
insteadjava.util.Iterator<AuxiliaryDatabaseObject> iterateAuxiliaryDatabaseObjects()
@Deprecated java.util.ListIterator<AuxiliaryDatabaseObject> iterateAuxliaryDatabaseObjectsInReverse()
iterateAuxiliaryDatabaseObjectsInReverse()
insteadjava.util.ListIterator<AuxiliaryDatabaseObject> iterateAuxiliaryDatabaseObjectsInReverse()
iterateAuxiliaryDatabaseObjects()
except that here the iterator is reversed.void addAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject)
auxiliaryDatabaseObject
- The metadata.java.lang.String getLogicalTableName(Table table) throws MappingException
table
- The table for which to determine the logical name.MappingException
- Indicates that no logical name was bound for the given physical table.void addTableBinding(java.lang.String schema, java.lang.String catalog, java.lang.String logicalName, java.lang.String physicalName, Table denormalizedSuperTable) throws DuplicateMappingException
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
- ???DuplicateMappingException
- Indicates physical table was already bound to another logical name.void addColumnBinding(java.lang.String logicalName, Column physicalColumn, Table table) throws DuplicateMappingException
logicalName
- 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.java.lang.String getPhysicalColumnName(java.lang.String logicalName, Table table) throws MappingException
logicalName
- The logical name binding.table
- The table metatdata.MappingException
- Indicates that no such binding was found.java.lang.String getLogicalColumnName(java.lang.String physicalName, Table table) throws MappingException
physicalName
- The physical column nametable
- The table metadata.MappingException
- Indicates that no such binding was found.void addSecondPass(SecondPass sp)
sp
- The second pass to add.void addSecondPass(SecondPass sp, boolean onTopOfTheQueue)
sp
- The second pass to add.onTopOfTheQueue
- True to add to the beginning of the queue; false to add to the end.void addPropertyReference(java.lang.String referencedClass, java.lang.String propertyName)
referencedClass
- The referenced entity name.propertyName
- The referenced property name.void addUniquePropertyReference(java.lang.String referencedClass, java.lang.String propertyName)
referencedClass
- The referenced entity name.propertyName
- The referenced property name.void addToExtendsQueue(ExtendsQueueEntry entry)
entry
- The entry to add.DefaultIdentifierGeneratorFactory getIdentifierGeneratorFactory()
void addMappedSuperclass(java.lang.Class type, MappedSuperclass mappedSuperclass)
type
- type corresponding to the MappedsuperclassmappedSuperclass
- MappedSuperclassMappedSuperclass getMappedSuperclass(java.lang.Class type)
type
- class corresponding to the MappedSuperclassObjectNameNormalizer getObjectNameNormalizer()
java.util.Properties getConfigurationProperties()
void addDefaultGenerator(IdGenerator generator)
generator
- The id generatorIdGenerator getGenerator(java.lang.String name)
name
- The generator name.IdGenerator getGenerator(java.lang.String name, java.util.Map<java.lang.String,IdGenerator> localGenerators)
name
- generator namelocalGenerators
- local generatorsvoid addGenerator(IdGenerator generator)
generator
- The generator to add.void addGeneratorTable(java.lang.String name, java.util.Properties params)
name
- The generator nameparams
- The generator table properties.java.util.Properties getGeneratorTableProperties(java.lang.String name, java.util.Map<java.lang.String,java.util.Properties> localGeneratorTables)
name
- generator namelocalGeneratorTables
- local generator tablesjava.util.Map<java.lang.String,Join> getJoins(java.lang.String entityName)
entityName
- The entity namevoid addJoins(PersistentClass persistentClass, java.util.Map<java.lang.String,Join> joins)
persistentClass
- The persistent entity metadata.joins
- The join metadata to add.MappingException
AnnotatedClassType getClassType(org.hibernate.annotations.common.reflection.XClass clazz)
clazz
- The XClass mappingAnnotatedClassType addClassType(org.hibernate.annotations.common.reflection.XClass clazz)
clazz
- The XClass mapping.java.util.Map<Table,java.util.List<java.lang.String[]>> getTableUniqueConstraints()
getUniqueConstraintHoldersByTable()
insteadjava.util.Map<Table,java.util.List<UniqueConstraintHolder>> getUniqueConstraintHoldersByTable()
void addUniqueConstraints(Table table, java.util.List uniqueConstraints)
void addUniqueConstraintHolders(Table table, java.util.List<UniqueConstraintHolder> uniqueConstraintHolders)
void addMappedBy(java.lang.String entityName, java.lang.String propertyName, java.lang.String inversePropertyName)
java.lang.String getFromMappedBy(java.lang.String entityName, java.lang.String propertyName)
void addPropertyReferencedAssociation(java.lang.String entityName, java.lang.String propertyName, java.lang.String propertyRef)
java.lang.String getPropertyReferencedAssociation(java.lang.String entityName, java.lang.String propertyName)
org.hibernate.annotations.common.reflection.ReflectionManager getReflectionManager()
void addDefaultQuery(java.lang.String name, NamedQueryDefinition query)
void addDefaultSQLQuery(java.lang.String name, NamedSQLQueryDefinition query)
void addDefaultResultSetMapping(ResultSetMappingDefinition definition)
java.util.Map getClasses()
void addAnyMetaDef(AnyMetaDef defAnn) throws AnnotationException
AnnotationException
AnyMetaDef getAnyMetaDef(java.lang.String name)
boolean isInSecondPass()
PropertyData getPropertyAnnotatedWithMapsId(org.hibernate.annotations.common.reflection.XClass entityType, java.lang.String propertyName)
void addPropertyAnnotatedWithMapsId(org.hibernate.annotations.common.reflection.XClass entityType, PropertyData property)
void addPropertyAnnotatedWithMapsIdSpecj(org.hibernate.annotations.common.reflection.XClass entityType, PropertyData property, java.lang.String mapsIdValue)
boolean isSpecjProprietarySyntaxEnabled()
boolean useNewGeneratorMappings()
Configuration.USE_NEW_ID_GENERATOR_MAPPINGS
setting.PropertyData getPropertyAnnotatedWithIdAndToOne(org.hibernate.annotations.common.reflection.XClass entityType, java.lang.String propertyName)
void addToOneAndIdProperty(org.hibernate.annotations.common.reflection.XClass entity, PropertyData property)
Copyright © 2013. All Rights Reserved.