Package org.hibernate.mapping
Class Collection
- java.lang.Object
-
- org.hibernate.mapping.Collection
-
- All Implemented Interfaces:
java.io.Serializable,Fetchable,Filterable,Value
- Direct Known Subclasses:
Bag,IdentifierCollection,IndexedCollection,Set
public abstract class Collection extends java.lang.Object implements Fetchable, Value, Filterable
Mapping for a collection. Subclasses specialize to particular collection styles.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_ELEMENT_COLUMN_NAMEstatic java.lang.StringDEFAULT_KEY_COLUMN_NAME
-
Constructor Summary
Constructors Modifier Constructor Description protectedCollection(MetadataBuildingContext buildingContext, PersistentClass owner)protectedCollection(MetadataImplementor metadata, PersistentClass owner)Deprecated.UseCollection(MetadataBuildingContext, PersistentClass)instead.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddFilter(java.lang.String name, java.lang.String condition, boolean autoAliasInjection, java.util.Map<java.lang.String,java.lang.String> aliasTableMap, java.util.Map<java.lang.String,java.lang.String> aliasEntityMap)voidaddManyToManyFilter(java.lang.String name, java.lang.String condition, boolean autoAliasInjection, java.util.Map<java.lang.String,java.lang.String> aliasTableMap, java.util.Map<java.lang.String,java.lang.String> aliasEntityMap)voidcreateAllKeys()voidcreateForeignKey()intgetBatchSize()java.lang.StringgetCacheConcurrencyStrategy()java.lang.StringgetCacheRegionName()java.lang.ClassgetCollectionPersisterClass()TablegetCollectionTable()CollectionTypegetCollectionType()boolean[]getColumnInsertability()java.util.Iterator<Selectable>getColumnIterator()intgetColumnSpan()boolean[]getColumnUpdateability()java.util.ComparatorgetComparator()java.lang.StringgetComparatorClassName()java.lang.StringgetCustomSQLDelete()java.lang.StringgetCustomSQLDeleteAll()ExecuteUpdateResultCheckStylegetCustomSQLDeleteAllCheckStyle()ExecuteUpdateResultCheckStylegetCustomSQLDeleteCheckStyle()java.lang.StringgetCustomSQLInsert()ExecuteUpdateResultCheckStylegetCustomSQLInsertCheckStyle()java.lang.StringgetCustomSQLUpdate()ExecuteUpdateResultCheckStylegetCustomSQLUpdateCheckStyle()abstract CollectionTypegetDefaultCollectionType()ValuegetElement()FetchModegetFetchMode()java.util.ListgetFilters()KeyValuegetKey()java.lang.StringgetLoaderName()java.util.ListgetManyToManyFilters()java.lang.StringgetManyToManyOrdering()java.lang.StringgetManyToManyWhere()java.lang.StringgetMappedByProperty()MetadataImplementorgetMetadata()java.lang.StringgetOrderBy()PersistentClassgetOwner()java.lang.StringgetOwnerEntityName()java.lang.StringgetReferencedPropertyName()java.lang.StringgetRole()ServiceRegistrygetServiceRegistry()java.util.Set<java.lang.String>getSynchronizedTables()TablegetTable()TypegetType()java.lang.StringgetTypeName()java.util.PropertiesgetTypeParameters()java.lang.StringgetWhere()booleanhasFormula()booleanhasOrder()booleanhasOrphanDelete()booleanisAlternateUniqueKey()booleanisArray()booleanisCustomDeleteAllCallable()booleanisCustomDeleteCallable()booleanisCustomInsertCallable()booleanisCustomUpdateCallable()booleanisExtraLazy()booleanisIdentified()booleanisIndexed()booleanisInverse()booleanisLazy()booleanisMap()booleanisMutable()booleanisNullable()booleanisOneToMany()booleanisOptimisticLocked()booleanisPrimitiveArray()booleanisSame(Collection other)booleanisSame(Value other)protected static booleanisSame(Value v1, Value v2)booleanisSet()booleanisSimpleValue()booleanisSorted()booleanisSubselectLoadable()booleanisValid(Mapping mapping)voidsetBatchSize(int i)voidsetCacheConcurrencyStrategy(java.lang.String cacheConcurrencyStrategy)voidsetCacheRegionName(java.lang.String cacheRegionName)voidsetCollectionPersisterClass(java.lang.Class persister)voidsetCollectionTable(Table table)voidsetComparator(java.util.Comparator comparator)voidsetComparatorClassName(java.lang.String comparatorClassName)voidsetCustomSQLDelete(java.lang.String customSQLDelete, boolean callable, ExecuteUpdateResultCheckStyle checkStyle)voidsetCustomSQLDeleteAll(java.lang.String customSQLDeleteAll, boolean callable, ExecuteUpdateResultCheckStyle checkStyle)voidsetCustomSQLInsert(java.lang.String customSQLInsert, boolean callable, ExecuteUpdateResultCheckStyle checkStyle)voidsetCustomSQLUpdate(java.lang.String customSQLUpdate, boolean callable, ExecuteUpdateResultCheckStyle checkStyle)voidsetElement(Value element)voidsetExtraLazy(boolean extraLazy)voidsetFetchMode(FetchMode fetchMode)voidsetInverse(boolean inverse)voidsetKey(KeyValue key)voidsetLazy(boolean lazy)voidsetLoaderName(java.lang.String name)voidsetManyToManyOrdering(java.lang.String orderFragment)voidsetManyToManyWhere(java.lang.String manyToManyWhere)voidsetMappedByProperty(java.lang.String mappedByProperty)voidsetMutable(boolean mutable)voidsetOptimisticLocked(boolean optimisticLocked)voidsetOrderBy(java.lang.String orderBy)voidsetOrphanDelete(boolean orphanDelete)voidsetOwner(PersistentClass owner)Deprecated.Inject the owner into constructor.voidsetReferencedPropertyName(java.lang.String propertyRef)voidsetRole(java.lang.String role)voidsetSorted(boolean sorted)voidsetSubselectLoadable(boolean subqueryLoadable)voidsetTypeName(java.lang.String typeName)voidsetTypeParameters(java.util.Map parameterMap)voidsetTypeParameters(java.util.Properties parameterMap)voidsetTypeUsingReflection(java.lang.String className, java.lang.String propertyName)voidsetWhere(java.lang.String where)java.lang.StringtoString()voidvalidate(Mapping mapping)
-
-
-
Field Detail
-
DEFAULT_ELEMENT_COLUMN_NAME
public static final java.lang.String DEFAULT_ELEMENT_COLUMN_NAME
- See Also:
- Constant Field Values
-
DEFAULT_KEY_COLUMN_NAME
public static final java.lang.String DEFAULT_KEY_COLUMN_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Collection
protected Collection(MetadataBuildingContext buildingContext, PersistentClass owner)
-
Collection
@Deprecated protected Collection(MetadataImplementor metadata, PersistentClass owner)
Deprecated.UseCollection(MetadataBuildingContext, PersistentClass)instead.
-
-
Method Detail
-
getMetadata
public MetadataImplementor getMetadata()
-
getServiceRegistry
public ServiceRegistry getServiceRegistry()
- Specified by:
getServiceRegistryin interfaceValue
-
isSet
public boolean isSet()
-
getKey
public KeyValue getKey()
-
getElement
public Value getElement()
-
isIndexed
public boolean isIndexed()
-
getCollectionTable
public Table getCollectionTable()
-
setCollectionTable
public void setCollectionTable(Table table)
-
isSorted
public boolean isSorted()
-
getComparator
public java.util.Comparator getComparator()
-
getRole
public java.lang.String getRole()
-
getDefaultCollectionType
public abstract CollectionType getDefaultCollectionType() throws MappingException
- Throws:
MappingException
-
isPrimitiveArray
public boolean isPrimitiveArray()
-
isArray
public boolean isArray()
-
hasFormula
public boolean hasFormula()
- Specified by:
hasFormulain interfaceValue
-
isOneToMany
public boolean isOneToMany()
-
isInverse
public boolean isInverse()
-
getOwnerEntityName
public java.lang.String getOwnerEntityName()
-
getOrderBy
public java.lang.String getOrderBy()
-
setComparator
public void setComparator(java.util.Comparator comparator)
-
setElement
public void setElement(Value element)
-
setKey
public void setKey(KeyValue key)
-
setOrderBy
public void setOrderBy(java.lang.String orderBy)
-
setRole
public void setRole(java.lang.String role)
-
setSorted
public void setSorted(boolean sorted)
-
setInverse
public void setInverse(boolean inverse)
-
getOwner
public PersistentClass getOwner()
-
setOwner
@Deprecated public void setOwner(PersistentClass owner)
Deprecated.Inject the owner into constructor.- Parameters:
owner- The owner
-
getWhere
public java.lang.String getWhere()
-
setWhere
public void setWhere(java.lang.String where)
-
getManyToManyWhere
public java.lang.String getManyToManyWhere()
-
setManyToManyWhere
public void setManyToManyWhere(java.lang.String manyToManyWhere)
-
getManyToManyOrdering
public java.lang.String getManyToManyOrdering()
-
setManyToManyOrdering
public void setManyToManyOrdering(java.lang.String orderFragment)
-
isIdentified
public boolean isIdentified()
-
hasOrphanDelete
public boolean hasOrphanDelete()
-
setOrphanDelete
public void setOrphanDelete(boolean orphanDelete)
-
getBatchSize
public int getBatchSize()
-
setBatchSize
public void setBatchSize(int i)
-
getFetchMode
public FetchMode getFetchMode()
- Specified by:
getFetchModein interfaceFetchable- Specified by:
getFetchModein interfaceValue
-
setFetchMode
public void setFetchMode(FetchMode fetchMode)
- Specified by:
setFetchModein interfaceFetchable
-
setCollectionPersisterClass
public void setCollectionPersisterClass(java.lang.Class persister)
-
getCollectionPersisterClass
public java.lang.Class getCollectionPersisterClass()
-
validate
public void validate(Mapping mapping) throws MappingException
- Throws:
MappingException
-
getColumnIterator
public java.util.Iterator<Selectable> getColumnIterator()
- Specified by:
getColumnIteratorin interfaceValue
-
getColumnSpan
public int getColumnSpan()
- Specified by:
getColumnSpanin interfaceValue
-
getType
public Type getType() throws MappingException
- Specified by:
getTypein interfaceValue- Throws:
MappingException
-
getCollectionType
public CollectionType getCollectionType()
-
isNullable
public boolean isNullable()
- Specified by:
isNullablein interfaceValue
-
isAlternateUniqueKey
public boolean isAlternateUniqueKey()
- Specified by:
isAlternateUniqueKeyin interfaceValue
-
createForeignKey
public void createForeignKey()
- Specified by:
createForeignKeyin interfaceValue
-
isSimpleValue
public boolean isSimpleValue()
- Specified by:
isSimpleValuein interfaceValue
-
isValid
public boolean isValid(Mapping mapping) throws MappingException
- Specified by:
isValidin interfaceValue- Throws:
MappingException
-
isSame
public boolean isSame(Collection other)
-
createAllKeys
public void createAllKeys() throws MappingException- Throws:
MappingException
-
getCacheConcurrencyStrategy
public java.lang.String getCacheConcurrencyStrategy()
-
setCacheConcurrencyStrategy
public void setCacheConcurrencyStrategy(java.lang.String cacheConcurrencyStrategy)
-
setTypeUsingReflection
public void setTypeUsingReflection(java.lang.String className, java.lang.String propertyName)- Specified by:
setTypeUsingReflectionin interfaceValue
-
getCacheRegionName
public java.lang.String getCacheRegionName()
-
setCacheRegionName
public void setCacheRegionName(java.lang.String cacheRegionName)
-
setCustomSQLInsert
public void setCustomSQLInsert(java.lang.String customSQLInsert, boolean callable, ExecuteUpdateResultCheckStyle checkStyle)
-
getCustomSQLInsert
public java.lang.String getCustomSQLInsert()
-
isCustomInsertCallable
public boolean isCustomInsertCallable()
-
getCustomSQLInsertCheckStyle
public ExecuteUpdateResultCheckStyle getCustomSQLInsertCheckStyle()
-
setCustomSQLUpdate
public void setCustomSQLUpdate(java.lang.String customSQLUpdate, boolean callable, ExecuteUpdateResultCheckStyle checkStyle)
-
getCustomSQLUpdate
public java.lang.String getCustomSQLUpdate()
-
isCustomUpdateCallable
public boolean isCustomUpdateCallable()
-
getCustomSQLUpdateCheckStyle
public ExecuteUpdateResultCheckStyle getCustomSQLUpdateCheckStyle()
-
setCustomSQLDelete
public void setCustomSQLDelete(java.lang.String customSQLDelete, boolean callable, ExecuteUpdateResultCheckStyle checkStyle)
-
getCustomSQLDelete
public java.lang.String getCustomSQLDelete()
-
isCustomDeleteCallable
public boolean isCustomDeleteCallable()
-
getCustomSQLDeleteCheckStyle
public ExecuteUpdateResultCheckStyle getCustomSQLDeleteCheckStyle()
-
setCustomSQLDeleteAll
public void setCustomSQLDeleteAll(java.lang.String customSQLDeleteAll, boolean callable, ExecuteUpdateResultCheckStyle checkStyle)
-
getCustomSQLDeleteAll
public java.lang.String getCustomSQLDeleteAll()
-
isCustomDeleteAllCallable
public boolean isCustomDeleteAllCallable()
-
getCustomSQLDeleteAllCheckStyle
public ExecuteUpdateResultCheckStyle getCustomSQLDeleteAllCheckStyle()
-
addFilter
public void addFilter(java.lang.String name, java.lang.String condition, boolean autoAliasInjection, java.util.Map<java.lang.String,java.lang.String> aliasTableMap, java.util.Map<java.lang.String,java.lang.String> aliasEntityMap)- Specified by:
addFilterin interfaceFilterable
-
getFilters
public java.util.List getFilters()
- Specified by:
getFiltersin interfaceFilterable
-
addManyToManyFilter
public void addManyToManyFilter(java.lang.String name, java.lang.String condition, boolean autoAliasInjection, java.util.Map<java.lang.String,java.lang.String> aliasTableMap, java.util.Map<java.lang.String,java.lang.String> aliasEntityMap)
-
getManyToManyFilters
public java.util.List getManyToManyFilters()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getSynchronizedTables
public java.util.Set<java.lang.String> getSynchronizedTables()
-
getLoaderName
public java.lang.String getLoaderName()
-
setLoaderName
public void setLoaderName(java.lang.String name)
-
getReferencedPropertyName
public java.lang.String getReferencedPropertyName()
-
setReferencedPropertyName
public void setReferencedPropertyName(java.lang.String propertyRef)
-
isOptimisticLocked
public boolean isOptimisticLocked()
-
setOptimisticLocked
public void setOptimisticLocked(boolean optimisticLocked)
-
isMap
public boolean isMap()
-
getTypeName
public java.lang.String getTypeName()
-
setTypeName
public void setTypeName(java.lang.String typeName)
-
getTypeParameters
public java.util.Properties getTypeParameters()
-
setTypeParameters
public void setTypeParameters(java.util.Properties parameterMap)
-
setTypeParameters
public void setTypeParameters(java.util.Map parameterMap)
-
getColumnInsertability
public boolean[] getColumnInsertability()
- Specified by:
getColumnInsertabilityin interfaceValue
-
getColumnUpdateability
public boolean[] getColumnUpdateability()
- Specified by:
getColumnUpdateabilityin interfaceValue
-
isSubselectLoadable
public boolean isSubselectLoadable()
-
setSubselectLoadable
public void setSubselectLoadable(boolean subqueryLoadable)
-
isMutable
public boolean isMutable()
-
setMutable
public void setMutable(boolean mutable)
-
isExtraLazy
public boolean isExtraLazy()
-
setExtraLazy
public void setExtraLazy(boolean extraLazy)
-
hasOrder
public boolean hasOrder()
-
setComparatorClassName
public void setComparatorClassName(java.lang.String comparatorClassName)
-
getComparatorClassName
public java.lang.String getComparatorClassName()
-
getMappedByProperty
public java.lang.String getMappedByProperty()
-
setMappedByProperty
public void setMappedByProperty(java.lang.String mappedByProperty)
-
-