org.hibernate.cfg
Interface ExtendedMappings

All Superinterfaces:
Mappings
All Known Implementing Classes:
AnnotationConfiguration.ExtendedMappingsImpl

public interface ExtendedMappings
extends Mappings

Allow annotation related mappings

at least for named generators

Author:
Emmanuel Bernard, Hardy Ferentschik

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.hibernate.cfg.Mappings
Mappings.PropertyReference
 
Method Summary
 void addAnnotationConfiguredFetchProfile(FetchProfile fetchProfile)
          Add the specified profile to the list of fetch profiles configured via annotations.
 void addAnyMetaDef(AnyMetaDef defAnn)
           
 AnnotatedClassType addClassType(org.hibernate.annotations.common.reflection.XClass clazz)
          FIXME should be private but will this break things? Add a class type.
 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)
           
 void addGenerator(IdGenerator generator)
          Add a generator.
 void addGeneratorTable(String name, Properties params)
          Add a generator table properties.
 void addJoins(PersistentClass persistentClass, Map<String,Join> joins)
          Add join metadata for a persistent entity.
 void addMappedBy(String entityName, String propertyName, String inversePropertyName)
           
 void addPropertyAnnotatedWithMapsId(org.hibernate.annotations.common.reflection.XClass entityType, PropertyData property)
           
 void addPropertyReferencedAssociation(String entityName, String propertyName, String propertyRef)
           
 void addToOneAndIdProperty(org.hibernate.annotations.common.reflection.XClass entity, PropertyData property)
           
 void addUniqueConstraintHolders(Table table, List<UniqueConstraintHolder> uniqueConstraintHolders)
           
 void addUniqueConstraints(Table table, List uniqueConstraints)
          Deprecated. Use addUniqueConstraintHolders(org.hibernate.mapping.Table, java.util.List) instead
 boolean containsAnnotationConfiguredFetchProfile(FetchProfile fetchProfile)
           
 AnyMetaDef getAnyMetaDef(String name)
           
 Map getClasses()
           
 AnnotatedClassType getClassType(org.hibernate.annotations.common.reflection.XClass clazz)
          Get and maintain a cache of class type.
 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.
 Map<String,Join> getJoins(String entityName)
          Retrieve join metadata for a particular persistent entity.
 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)
           
 org.hibernate.annotations.common.reflection.ReflectionManager getReflectionManager()
           
 Map<Table,List<String[]>> getTableUniqueConstraints()
          Deprecated. Use getUniqueConstraintHoldersByTable() instead
 Map<Table,List<UniqueConstraintHolder>> getUniqueConstraintHoldersByTable()
           
 boolean isInSecondPass()
           
 boolean useNewGeneratorMappings()
          Should we use the new generator strategy mappings.
 
Methods inherited from interface org.hibernate.cfg.Mappings
addAuxiliaryDatabaseObject, addClass, addCollection, addColumnBinding, addDenormalizedTable, addFilterDefinition, addImport, addMappedSuperclass, addPropertyReference, addQuery, addResultSetMapping, addSecondPass, addSecondPass, addSQLQuery, addTable, addTableBinding, addToExtendsQueue, addTypeDef, addUniquePropertyReference, findOrCreateFetchProfile, getCatalogName, getClass, getCollection, getConfigurationProperties, getDefaultAccess, getDefaultCascade, getDefaultPackage, getFilterDefinition, getFilterDefinitions, getIdentifierGeneratorFactory, getLogicalColumnName, getLogicalTableName, getMappedSuperclass, getNamingStrategy, getObjectNameNormalizer, getPhysicalColumnName, getQuery, getResultSetMapping, getSchemaName, getSQLQuery, getTable, getTypeDef, isAutoImport, isDefaultLazy, iterateAuxliaryDatabaseObjects, iterateAuxliaryDatabaseObjectsInReverse, iterateClasses, iterateCollections, iterateTables, locatePersistentClassByEntityName, setAutoImport, setCatalogName, setDefaultAccess, setDefaultCascade, setDefaultLazy, setDefaultPackage, setNamingStrategy, setSchemaName
 

Method Detail

addDefaultGenerator

void addDefaultGenerator(IdGenerator generator)
Adds a default id generator.

Parameters:
generator - The id generator

getGenerator

IdGenerator getGenerator(String name)
Retrieve the id-generator by name.

Parameters:
name - The generator name.
Returns:
The generator, or null.

getGenerator

IdGenerator getGenerator(String name,
                         Map<String,IdGenerator> localGenerators)
Try to find the generator from the localGenerators and then from the global generator list

Parameters:
name - generator name
localGenerators - local generators
Returns:
the appropriate idgenerator or null if not found

addGenerator

void addGenerator(IdGenerator generator)
Add a generator.

Parameters:
generator - The generator to add.

addGeneratorTable

void addGeneratorTable(String name,
                       Properties params)
Add a generator table properties.

Parameters:
name - The generator name
params - The generator table properties.

getGeneratorTableProperties

Properties getGeneratorTableProperties(String name,
                                       Map<String,Properties> localGeneratorTables)
Retrieve the properties related to a generator table.

Parameters:
name - generator name
localGeneratorTables - local generator tables
Returns:
The properties, or null.

getJoins

Map<String,Join> getJoins(String entityName)
Retrieve join metadata for a particular persistent entity.

Parameters:
entityName - The entity name
Returns:
The join metadata

addJoins

void addJoins(PersistentClass persistentClass,
              Map<String,Join> joins)
Add join metadata for a persistent entity.

Parameters:
persistentClass - The persistent entity metadata.
joins - The join metadata to add.
Throws:
MappingException

getClassType

AnnotatedClassType getClassType(org.hibernate.annotations.common.reflection.XClass clazz)
Get and maintain a cache of class type.

Parameters:
clazz - The XClass mapping
Returns:
The class type.

addClassType

AnnotatedClassType addClassType(org.hibernate.annotations.common.reflection.XClass clazz)
FIXME should be private but will this break things? Add a class type.

Parameters:
clazz - The XClass mapping.
Returns:
The class type.

getTableUniqueConstraints

Map<Table,List<String[]>> getTableUniqueConstraints()
Deprecated. Use getUniqueConstraintHoldersByTable() instead


getUniqueConstraintHoldersByTable

Map<Table,List<UniqueConstraintHolder>> getUniqueConstraintHoldersByTable()

addUniqueConstraints

void addUniqueConstraints(Table table,
                          List uniqueConstraints)
Deprecated. Use addUniqueConstraintHolders(org.hibernate.mapping.Table, java.util.List) instead


addUniqueConstraintHolders

void addUniqueConstraintHolders(Table table,
                                List<UniqueConstraintHolder> uniqueConstraintHolders)

addMappedBy

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

getFromMappedBy

String getFromMappedBy(String entityName,
                       String propertyName)

addPropertyReferencedAssociation

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

getPropertyReferencedAssociation

String getPropertyReferencedAssociation(String entityName,
                                        String propertyName)

getReflectionManager

org.hibernate.annotations.common.reflection.ReflectionManager getReflectionManager()

addDefaultQuery

void addDefaultQuery(String name,
                     NamedQueryDefinition query)

addDefaultSQLQuery

void addDefaultSQLQuery(String name,
                        NamedSQLQueryDefinition query)

addDefaultResultSetMapping

void addDefaultResultSetMapping(ResultSetMappingDefinition definition)

getClasses

Map getClasses()

addAnyMetaDef

void addAnyMetaDef(AnyMetaDef defAnn)
                   throws AnnotationException
Throws:
AnnotationException

getAnyMetaDef

AnyMetaDef getAnyMetaDef(String name)

isInSecondPass

boolean isInSecondPass()

getPropertyAnnotatedWithMapsId

PropertyData getPropertyAnnotatedWithMapsId(org.hibernate.annotations.common.reflection.XClass entityType,
                                            String propertyName)
Return the property annotated with @MapsId("propertyName") if any. Null otherwise


addPropertyAnnotatedWithMapsId

void addPropertyAnnotatedWithMapsId(org.hibernate.annotations.common.reflection.XClass entityType,
                                    PropertyData property)

useNewGeneratorMappings

boolean useNewGeneratorMappings()
Should we use the new generator strategy mappings. This is controlled by the AnnotationConfiguration.USE_NEW_ID_GENERATOR_MAPPINGS setting.

Returns:
True if the new generators should be used, false otherwise.

getPropertyAnnotatedWithIdAndToOne

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


addToOneAndIdProperty

void addToOneAndIdProperty(org.hibernate.annotations.common.reflection.XClass entity,
                           PropertyData property)

addAnnotationConfiguredFetchProfile

void addAnnotationConfiguredFetchProfile(FetchProfile fetchProfile)
Add the specified profile to the list of fetch profiles configured via annotations.

Parameters:
fetchProfile - the fetch profile

containsAnnotationConfiguredFetchProfile

boolean containsAnnotationConfiguredFetchProfile(FetchProfile fetchProfile)
Returns:
if the provided fetch profile has been configured via xml, .


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