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 class Collection
extends Object
implements Fetchable, Value, Filterable, SoftDeletable
A mapping model object representing a collection. Subclasses specialize to particular kinds of collection.
- See Also:
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
Collection
(Supplier<ManagedBean<? extends UserCollectionType>> customTypeBeanResolver, PersistentClass owner, MetadataBuildingContext buildingContext) Annotation bindingprotected
Collection
(MetadataBuildingContext buildingContext, PersistentClass owner) hbm.xml bindingprotected
Collection
(Collection original) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFilter
(String name, String condition, boolean autoAliasInjection, Map<String, String> aliasTableMap, Map<String, String> aliasEntityMap) void
addManyToManyFilter
(String name, String condition, boolean autoAliasInjection, Map<String, String> aliasTableMap, Map<String, String> aliasEntityMap) void
addSynchronizedTable
(String table) void
void
void
createUniqueKey
(MetadataBuildingContext context) void
enableSoftDelete
(Column indicatorColumn) int
CollectionSemantics<?,
?> boolean[]
If the mapping involves only columns, return them.int
The number of columns and formulas in the mapping.boolean[]
Comparator<?>
abstract CollectionType
Supplier<? extends Expectation>
Supplier<? extends Expectation>
Supplier<? extends Expectation>
getKey()
getOwner()
getRole()
The mapping to columns and formulas.getTable()
getType()
Supplier<? extends Expectation>
getWhere()
boolean
boolean
boolean
boolean
hasOrder()
boolean
boolean
boolean
isArray()
boolean
isColumnInsertable
(int index) boolean
isColumnUpdateable
(int index) boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isLazy()
boolean
isMap()
boolean
boolean
boolean
boolean
boolean
boolean
isSame
(Collection other) boolean
protected static boolean
boolean
isSet()
boolean
boolean
isSorted()
boolean
boolean
isValid
(MappingContext mappingContext) void
setBatchSize
(int batchSize) void
setCacheConcurrencyStrategy
(String cacheConcurrencyStrategy) void
setCacheRegionName
(String cacheRegionName) void
setCollectionTable
(Table table) void
setComparator
(Comparator comparator) void
setComparatorClassName
(String comparatorClassName) void
setCustomSQLDelete
(String customSQLDelete, boolean callable, ExecuteUpdateResultCheckStyle checkStyle) void
setCustomSQLDeleteAll
(String customSQLDeleteAll, boolean callable, ExecuteUpdateResultCheckStyle checkStyle) void
setCustomSQLInsert
(String customSQLInsert, boolean callable, ExecuteUpdateResultCheckStyle checkStyle) void
setCustomSQLUpdate
(String customSQLUpdate, boolean callable, ExecuteUpdateResultCheckStyle checkStyle) void
setDeleteAllExpectation
(Supplier<? extends Expectation> deleteAllExpectation) void
setDeleteExpectation
(Supplier<? extends Expectation> deleteExpectation) void
setElement
(Value element) void
setExtraLazy
(boolean extraLazy) void
setFetchMode
(FetchMode fetchMode) void
setInsertExpectation
(Supplier<? extends Expectation> insertExpectation) void
setInverse
(boolean inverse) void
void
setLazy
(boolean lazy) void
setLoaderName
(String name) void
setManyToManyOrdering
(String orderFragment) void
setManyToManyWhere
(String manyToManyWhere) void
setMappedByProperty
(String mappedByProperty) void
setMutable
(boolean mutable) void
setOptimisticLocked
(boolean optimisticLocked) void
setOrderBy
(String orderBy) void
setOrphanDelete
(boolean orphanDelete) void
setQueryCacheLayout
(CacheLayout queryCacheLayout) void
setReferencedPropertyName
(String propertyRef) void
void
setSorted
(boolean sorted) void
setSubselectLoadable
(boolean subqueryLoadable) void
setTypeName
(String typeName) void
setTypeParameters
(Map typeParameters) void
setTypeParameters
(Properties parameterMap) void
setTypeUsingReflection
(String className, String propertyName) void
setUpdateExpectation
(Supplier<? extends Expectation> updateExpectation) void
toString()
void
Deprecated.void
validate
(MappingContext mappingContext) 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, getSelectableType, getVirtualSelectables, isValid
-
Field Details
-
DEFAULT_ELEMENT_COLUMN_NAME
- See Also:
-
DEFAULT_KEY_COLUMN_NAME
- See Also:
-
-
Constructor Details
-
Collection
hbm.xml binding -
Collection
protected Collection(Supplier<ManagedBean<? extends UserCollectionType>> customTypeBeanResolver, PersistentClass owner, MetadataBuildingContext buildingContext) Annotation binding -
Collection
-
-
Method Details
-
getBuildingContext
- Specified by:
getBuildingContext
in interfaceValue
-
getMetadata
-
getServiceRegistry
- Specified by:
getServiceRegistry
in interfaceValue
-
isSet
public boolean isSet() -
getKey
-
getElement
-
isIndexed
public boolean isIndexed() -
getCollectionTable
-
setCollectionTable
-
isSorted
public boolean isSorted() -
getComparator
-
isLazy
public boolean isLazy() -
setLazy
public void setLazy(boolean lazy) -
getRole
-
getDefaultCollectionType
- Throws:
MappingException
-
isPrimitiveArray
public boolean isPrimitiveArray() -
isArray
public boolean isArray() -
hasFormula
public boolean hasFormula()- Specified by:
hasFormula
in interfaceValue
-
isOneToMany
public boolean isOneToMany() -
isInverse
public boolean isInverse() -
getOwnerEntityName
-
getOrderBy
-
setComparator
-
setElement
-
setKey
-
setOrderBy
-
setRole
-
setSorted
public void setSorted(boolean sorted) -
setInverse
public void setInverse(boolean inverse) -
getOwner
-
getWhere
-
setWhere
-
getManyToManyWhere
-
setManyToManyWhere
-
getManyToManyOrdering
-
setManyToManyOrdering
-
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
- Specified by:
getFetchMode
in interfaceFetchable
- Specified by:
getFetchMode
in interfaceValue
-
setFetchMode
- Specified by:
setFetchMode
in interfaceFetchable
-
validate
Deprecated.- Throws:
MappingException
-
validate
- Throws:
MappingException
-
getSelectables
Description copied from interface:Value
The mapping to columns and formulas.- Specified by:
getSelectables
in interfaceValue
-
getColumns
Description copied from interface:Value
If the mapping involves only columns, return them.- Specified by:
getColumns
in interfaceValue
-
getColumnSpan
public int getColumnSpan()Description copied from interface:Value
The number of columns and formulas in the mapping.- Specified by:
getColumnSpan
in interfaceValue
-
getType
- Specified by:
getType
in interfaceValue
- Throws:
MappingException
-
getCollectionSemantics
-
getCollectionType
-
isNullable
public boolean isNullable()- Specified by:
isNullable
in interfaceValue
-
isAlternateUniqueKey
public boolean isAlternateUniqueKey()- Specified by:
isAlternateUniqueKey
in interfaceValue
-
getTable
-
createForeignKey
public void createForeignKey()- Specified by:
createForeignKey
in interfaceValue
-
createUniqueKey
- Specified by:
createUniqueKey
in interfaceValue
-
isSimpleValue
public boolean isSimpleValue()- Specified by:
isSimpleValue
in interfaceValue
-
isValid
-
isSame
-
isSame
-
isSame
-
createAllKeys
- Throws:
MappingException
-
getCacheConcurrencyStrategy
-
setCacheConcurrencyStrategy
-
setTypeUsingReflection
- Specified by:
setTypeUsingReflection
in interfaceValue
-
getCacheRegionName
-
setCacheRegionName
-
getQueryCacheLayout
-
setQueryCacheLayout
-
setCustomSQLInsert
public void setCustomSQLInsert(String customSQLInsert, boolean callable, ExecuteUpdateResultCheckStyle checkStyle) -
getCustomSQLInsert
-
isCustomInsertCallable
public boolean isCustomInsertCallable() -
setCustomSQLUpdate
public void setCustomSQLUpdate(String customSQLUpdate, boolean callable, ExecuteUpdateResultCheckStyle checkStyle) -
getCustomSQLUpdate
-
isCustomUpdateCallable
public boolean isCustomUpdateCallable() -
setCustomSQLDelete
public void setCustomSQLDelete(String customSQLDelete, boolean callable, ExecuteUpdateResultCheckStyle checkStyle) -
getCustomSQLDelete
-
isCustomDeleteCallable
public boolean isCustomDeleteCallable() -
setCustomSQLDeleteAll
public void setCustomSQLDeleteAll(String customSQLDeleteAll, boolean callable, ExecuteUpdateResultCheckStyle checkStyle) -
getCustomSQLDeleteAll
-
isCustomDeleteAllCallable
public boolean isCustomDeleteAllCallable() -
getCustomSQLDeleteAllCheckStyle
-
addFilter
public void addFilter(String name, String condition, boolean autoAliasInjection, Map<String, String> aliasTableMap, Map<String, String> aliasEntityMap) - Specified by:
addFilter
in interfaceFilterable
-
getFilters
- Specified by:
getFilters
in interfaceFilterable
-
addManyToManyFilter
-
getManyToManyFilters
-
toString
-
getSynchronizedTables
-
addSynchronizedTable
-
getLoaderName
-
setLoaderName
-
getReferencedPropertyName
-
setReferencedPropertyName
-
isOptimisticLocked
public boolean isOptimisticLocked() -
setOptimisticLocked
public void setOptimisticLocked(boolean optimisticLocked) -
isMap
public boolean isMap() -
getTypeName
-
setTypeName
-
getTypeParameters
-
setTypeParameters
-
setTypeParameters
-
getColumnInsertability
public boolean[] getColumnInsertability()- Specified by:
getColumnInsertability
in interfaceValue
-
hasAnyInsertableColumns
public boolean hasAnyInsertableColumns()- Specified by:
hasAnyInsertableColumns
in interfaceValue
-
getColumnUpdateability
public boolean[] getColumnUpdateability()- Specified by:
getColumnUpdateability
in interfaceValue
-
hasAnyUpdatableColumns
public boolean hasAnyUpdatableColumns()- Specified by:
hasAnyUpdatableColumns
in 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
-
getComparatorClassName
-
getMappedByProperty
-
setMappedByProperty
-
isColumnInsertable
public boolean isColumnInsertable(int index) - Specified by:
isColumnInsertable
in interfaceValue
-
isColumnUpdateable
public boolean isColumnUpdateable(int index) - Specified by:
isColumnUpdateable
in interfaceValue
-
enableSoftDelete
- Specified by:
enableSoftDelete
in interfaceSoftDeletable
-
getSoftDeleteColumn
- Specified by:
getSoftDeleteColumn
in interfaceSoftDeletable
-
getInsertExpectation
-
setInsertExpectation
-
getUpdateExpectation
-
setUpdateExpectation
-
getDeleteExpectation
-
setDeleteExpectation
-
getDeleteAllExpectation
-
setDeleteAllExpectation
-
validate(MappingContext)