Package org.hibernate.mapping
Class Collection
- java.lang.Object
- org.hibernate.mapping.Collection
- All Implemented Interfaces:
Serializable,Fetchable,Filterable,SoftDeletable,Value
- Direct Known Subclasses:
Bag,IdentifierCollection,IndexedCollection,Set
public abstract classCollectionextendsObjectimplementsFetchable,Value,Filterable,SoftDeletable
A mapping model object representing a collection. Subclasses specialize to particular kinds of collection.- See Also:
- Serialized Form
Field Summary
Fields Modifier and Type Field Description staticStringDEFAULT_ELEMENT_COLUMN_NAMEstaticStringDEFAULT_KEY_COLUMN_NAME
Constructor Summary
Constructors Modifier Constructor Description protectedCollection(Supplier<ManagedBean<? extendsUserCollectionType>> customTypeBeanResolver,PersistentClass owner,MetadataBuildingContext buildingContext)Annotation bindingprotectedCollection(MetadataBuildingContext buildingContext,PersistentClass owner)hbm.xml bindingprotectedCollection(Collection original)
Method Summary
Methods inherited from class java.lang.Object
clone,equals,finalize,getClass,hashCode,notify,notifyAll,wait,wait,wait
Methods inherited from interface org.hibernate.mapping.Value
accept,checkColumnDuplication,copy,getConstraintColumns,getExtraCreateTableInfo,getSelectableType,getVirtualSelectables
Field Detail
DEFAULT_ELEMENT_COLUMN_NAME
public static final String DEFAULT_ELEMENT_COLUMN_NAME
- See Also:
- Constant Field Values
DEFAULT_KEY_COLUMN_NAME
public static final String DEFAULT_KEY_COLUMN_NAME
- See Also:
- Constant Field Values
Constructor Detail
Collection
protected Collection(MetadataBuildingContext buildingContext,PersistentClass owner)
hbm.xml binding
Collection
protected Collection(Supplier<ManagedBean<? extendsUserCollectionType>> customTypeBeanResolver,PersistentClass owner,MetadataBuildingContext buildingContext)
Annotation binding
Collection
protected Collection(Collection original)
Method Detail
getBuildingContext
public MetadataBuildingContext getBuildingContext()
- Specified by:
getBuildingContextin interfaceValue
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 Comparator<?> getComparator()
getRole
public String getRole()
getDefaultCollectionType
public abstract CollectionType getDefaultCollectionType() throwsMappingException
- 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 String getOwnerEntityName()
getOrderBy
public String getOrderBy()
setComparator
public void setComparator(Comparator comparator)
setElement
public void setElement(Value element)
setKey
public void setKey(KeyValue key)
setOrderBy
public void setOrderBy(String orderBy)
setRole
public void setRole(String role)
setSorted
public void setSorted(boolean sorted)
setInverse
public void setInverse(boolean inverse)
getOwner
public PersistentClass getOwner()
getWhere
public String getWhere()
setWhere
public void setWhere(String where)
getManyToManyWhere
public String getManyToManyWhere()
setManyToManyWhere
public void setManyToManyWhere(String manyToManyWhere)
getManyToManyOrdering
public String getManyToManyOrdering()
setManyToManyOrdering
public void setManyToManyOrdering(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 batchSize)
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(Class<? extendsCollectionPersister> persister)
getCollectionPersisterClass
public Class<? extendsCollectionPersister> getCollectionPersisterClass()
validate
public void validate(Mapping mapping) throwsMappingException
- Throws:
MappingException
getSelectables
public List<Selectable> getSelectables()
Description copied from interface:ValueThe mapping to columns and formulas.- Specified by:
getSelectablesin interfaceValue
getColumns
public List<Column> getColumns()
Description copied from interface:ValueIf the mapping involves only columns, return them.- Specified by:
getColumnsin interfaceValue
getColumnSpan
public int getColumnSpan()
Description copied from interface:ValueThe number of columns and formulas in the mapping.- Specified by:
getColumnSpanin interfaceValue
getType
public Type getType() throwsMappingException
- Specified by:
getTypein interfaceValue- Throws:
MappingException
getCollectionSemantics
public CollectionSemantics<?,?> getCollectionSemantics()
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
createUniqueKey
public void createUniqueKey(MetadataBuildingContext context)
- Specified by:
createUniqueKeyin interfaceValue
isSimpleValue
public boolean isSimpleValue()
- Specified by:
isSimpleValuein interfaceValue
isSame
public boolean isSame(Collection other)
createAllKeys
public void createAllKeys() throwsMappingException
- Throws:
MappingException
getCacheConcurrencyStrategy
public String getCacheConcurrencyStrategy()
setCacheConcurrencyStrategy
public void setCacheConcurrencyStrategy(String cacheConcurrencyStrategy)
setTypeUsingReflection
public void setTypeUsingReflection(String className,String propertyName)
- Specified by:
setTypeUsingReflectionin interfaceValue
getCacheRegionName
public String getCacheRegionName()
setCacheRegionName
public void setCacheRegionName(String cacheRegionName)
getQueryCacheLayout
public CacheLayout getQueryCacheLayout()
setQueryCacheLayout
public void setQueryCacheLayout(CacheLayout queryCacheLayout)
setCustomSQLInsert
public void setCustomSQLInsert(String customSQLInsert, boolean callable,ExecuteUpdateResultCheckStyle checkStyle)
getCustomSQLInsert
public String getCustomSQLInsert()
isCustomInsertCallable
public boolean isCustomInsertCallable()
getCustomSQLInsertCheckStyle
@Deprecated(since="6.5",forRemoval=true)public ExecuteUpdateResultCheckStyle getCustomSQLInsertCheckStyle()
Deprecated, for removal: This API element is subject to removal in a future version.
setCustomSQLUpdate
public void setCustomSQLUpdate(String customSQLUpdate, boolean callable,ExecuteUpdateResultCheckStyle checkStyle)
getCustomSQLUpdate
public String getCustomSQLUpdate()
isCustomUpdateCallable
public boolean isCustomUpdateCallable()
getCustomSQLUpdateCheckStyle
@Deprecated(since="6.5",forRemoval=true)public ExecuteUpdateResultCheckStyle getCustomSQLUpdateCheckStyle()
Deprecated, for removal: This API element is subject to removal in a future version.
setCustomSQLDelete
public void setCustomSQLDelete(String customSQLDelete, boolean callable,ExecuteUpdateResultCheckStyle checkStyle)
getCustomSQLDelete
public String getCustomSQLDelete()
isCustomDeleteCallable
public boolean isCustomDeleteCallable()
getCustomSQLDeleteCheckStyle
@Deprecated(since="6.5",forRemoval=true)public ExecuteUpdateResultCheckStyle getCustomSQLDeleteCheckStyle()
Deprecated, for removal: This API element is subject to removal in a future version.
setCustomSQLDeleteAll
public void setCustomSQLDeleteAll(String customSQLDeleteAll, boolean callable,ExecuteUpdateResultCheckStyle checkStyle)
getCustomSQLDeleteAll
public String getCustomSQLDeleteAll()
isCustomDeleteAllCallable
public boolean isCustomDeleteAllCallable()
getCustomSQLDeleteAllCheckStyle
public ExecuteUpdateResultCheckStyle getCustomSQLDeleteAllCheckStyle()
addFilter
public void addFilter(String name,String condition, boolean autoAliasInjection,Map<String,String> aliasTableMap,Map<String,String> aliasEntityMap)
- Specified by:
addFilterin interfaceFilterable
getFilters
public List<FilterConfiguration> getFilters()
- Specified by:
getFiltersin interfaceFilterable
addManyToManyFilter
public void addManyToManyFilter(String name,String condition, boolean autoAliasInjection,Map<String,String> aliasTableMap,Map<String,String> aliasEntityMap)
getManyToManyFilters
public List<FilterConfiguration> getManyToManyFilters()
addSynchronizedTable
public void addSynchronizedTable(String table)
getLoaderName
public String getLoaderName()
setLoaderName
public void setLoaderName(String name)
getReferencedPropertyName
public String getReferencedPropertyName()
setReferencedPropertyName
public void setReferencedPropertyName(String propertyRef)
isOptimisticLocked
public boolean isOptimisticLocked()
setOptimisticLocked
public void setOptimisticLocked(boolean optimisticLocked)
isMap
public boolean isMap()
getTypeName
public String getTypeName()
setTypeName
public void setTypeName(String typeName)
getTypeParameters
public Properties getTypeParameters()
setTypeParameters
public void setTypeParameters(Properties parameterMap)
setTypeParameters
public void setTypeParameters(Map typeParameters)
getColumnInsertability
public boolean[] getColumnInsertability()
- Specified by:
getColumnInsertabilityin interfaceValue
hasAnyInsertableColumns
public boolean hasAnyInsertableColumns()
- Specified by:
hasAnyInsertableColumnsin interfaceValue
getColumnUpdateability
public boolean[] getColumnUpdateability()
- Specified by:
getColumnUpdateabilityin interfaceValue
hasAnyUpdatableColumns
public boolean hasAnyUpdatableColumns()
- Specified by:
hasAnyUpdatableColumnsin 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(String comparatorClassName)
getComparatorClassName
public String getComparatorClassName()
getMappedByProperty
public String getMappedByProperty()
setMappedByProperty
public void setMappedByProperty(String mappedByProperty)
isColumnInsertable
public boolean isColumnInsertable(int index)
- Specified by:
isColumnInsertablein interfaceValue
isColumnUpdateable
public boolean isColumnUpdateable(int index)
- Specified by:
isColumnUpdateablein interfaceValue
enableSoftDelete
public void enableSoftDelete(Column indicatorColumn)
- Specified by:
enableSoftDeletein interfaceSoftDeletable
getSoftDeleteColumn
public Column getSoftDeleteColumn()
- Specified by:
getSoftDeleteColumnin interfaceSoftDeletable
getInsertExpectation
public Supplier<? extendsExpectation> getInsertExpectation()
setInsertExpectation
public void setInsertExpectation(Supplier<? extendsExpectation> insertExpectation)
getUpdateExpectation
public Supplier<? extendsExpectation> getUpdateExpectation()
setUpdateExpectation
public void setUpdateExpectation(Supplier<? extendsExpectation> updateExpectation)
getDeleteExpectation
public Supplier<? extendsExpectation> getDeleteExpectation()
setDeleteExpectation
public void setDeleteExpectation(Supplier<? extendsExpectation> deleteExpectation)
getDeleteAllExpectation
public Supplier<? extendsExpectation> getDeleteAllExpectation()
setDeleteAllExpectation
public void setDeleteAllExpectation(Supplier<? extendsExpectation> deleteAllExpectation)