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 sealed classCollectionextendsObjectimplementsFetchable,Value,Filterable,SoftDeletablepermitsSet,Bag,IndexedCollection,IdentifierCollection
A mapping model object representing a collection. Subclasses specialize to particular kinds of collection.
- See Also:
Field Summary
FieldsConstructor Summary
ConstructorsModifierConstructorDescriptionprotectedCollection(Supplier<ManagedBean<? extendsUserCollectionType>> customTypeBeanResolver,PersistentClass owner,MetadataBuildingContext buildingContext) Annotation bindingprotectedCollection(MetadataBuildingContext buildingContext,PersistentClass owner) hbm.xml bindingprotectedCollection(Collection original) Method Summary
Modifier and TypeMethodDescriptionvoidaddFilter(String name,String condition, boolean autoAliasInjection,Map<String, String> aliasTableMap,Map<String, String> aliasEntityMap) voidaddManyToManyFilter(String name,String condition, boolean autoAliasInjection,Map<String, String> aliasTableMap,Map<String, String> aliasEntityMap) voidaddSynchronizedTable(String table) voidvoidvoidcreateUniqueKey(MetadataBuildingContext context) voidenableSoftDelete(Column indicatorColumn,SoftDeleteType strategy) Enable soft-delete for this part of the model.intCollectionSemantics<?,?> boolean[]If the mapping involves only columns, return them.intThe number of columns and formulas in the mapping.boolean[]Comparator<?>abstractCollectionTypeSupplier<? extendsExpectation>Supplier<? extendsExpectation>Supplier<? extendsExpectation>getKey()getOwner()getRole()The mapping to columns and formulas.The column which indicates soft-deletion.The strategy for indicating soft-deletion.getTable()getType()Deprecated, for removal: This API element is subject to removal in a future version.Supplier<? extendsExpectation>getWhere()booleanbooleanbooleanbooleanhasOrder()booleanbooleanbooleanisArray()booleanisColumnInsertable(int index) booleanisColumnUpdateable(int index) booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanisLazy()booleanisMap()booleanbooleanbooleanbooleanbooleanbooleanisSame(Collection other) booleanprotected static booleanbooleanisSet()booleanbooleanisSorted()booleanbooleanisValid(MappingContext mappingContext) voidsetBatchSize(int batchSize) voidsetCacheConcurrencyStrategy(String cacheConcurrencyStrategy) voidsetCacheRegionName(String cacheRegionName) voidsetCollectionTable(Table table) voidsetComparator(Comparator comparator) voidsetComparatorClassName(String comparatorClassName) voidsetCustomSQLDelete(String customSQLDelete, boolean callable,ExecuteUpdateResultCheckStyle checkStyle) voidsetCustomSQLDeleteAll(String customSQLDeleteAll, boolean callable,ExecuteUpdateResultCheckStyle checkStyle) voidsetCustomSQLInsert(String customSQLInsert, boolean callable,ExecuteUpdateResultCheckStyle checkStyle) voidsetCustomSQLUpdate(String customSQLUpdate, boolean callable,ExecuteUpdateResultCheckStyle checkStyle) voidsetDeleteAllExpectation(Supplier<? extendsExpectation> deleteAllExpectation) voidsetDeleteExpectation(Supplier<? extendsExpectation> deleteExpectation) voidsetElement(Value element) voidsetExtraLazy(boolean extraLazy) voidsetFetchMode(FetchMode fetchMode) voidsetInsertExpectation(Supplier<? extendsExpectation> insertExpectation) voidsetInverse(boolean inverse) voidvoidsetLazy(boolean lazy) voidsetLoaderName(String name) voidsetManyToManyOrdering(String orderFragment) voidsetManyToManyWhere(String manyToManyWhere) voidsetMappedByProperty(String mappedByProperty) voidsetMutable(boolean mutable) voidsetOptimisticLocked(boolean optimisticLocked) voidsetOrderBy(String orderBy) voidsetOrphanDelete(boolean orphanDelete) voidsetQueryCacheLayout(CacheLayout queryCacheLayout) voidsetReferencedPropertyName(String propertyRef) voidvoidsetSorted(boolean sorted) voidsetSubselectLoadable(boolean subqueryLoadable) voidsetTypeName(String typeName) voidsetTypeParameters(Map<String, String> typeParameters) voidsetTypeParameters(Properties parameterMap) Deprecated, for removal: This API element is subject to removal in a future version.voidsetTypeUsingReflection(String className,String propertyName) voidsetUpdateExpectation(Supplier<? extendsExpectation> updateExpectation) voidtoString()voidvalidate(MappingContext mappingContext) Methods inherited from class java.lang.Object
clone,equals,finalize,getClass,hashCode,notify,notifyAll,wait,wait,waitMethods inherited from interface org.hibernate.mapping.Value
accept,checkColumnDuplication,copy,getConstraintColumns,getExtraCreateTableInfo,getSelectableType,getVirtualSelectables
Field Details
DEFAULT_ELEMENT_COLUMN_NAME
- See Also:
DEFAULT_KEY_COLUMN_NAME
- See Also:
Constructor Details
Collection
hbm.xml bindingCollection
protected Collection(Supplier<ManagedBean<? extendsUserCollectionType>> customTypeBeanResolver,PersistentClass owner,MetadataBuildingContext buildingContext) Annotation bindingCollection
Method Details
getBuildingContext
- Specified by:
getBuildingContextin interfaceValue
getMetadata
getServiceRegistry
- Specified by:
getServiceRegistryin 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
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
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:
getFetchModein interfaceFetchable- Specified by:
getFetchModein interfaceValue
setFetchMode
- Specified by:
setFetchModein interfaceFetchable
validate
- Throws:
MappingException
getSelectables
Description copied from interface:ValueThe mapping to columns and formulas.- Specified by:
getSelectablesin interfaceValue
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
- Specified by:
getTypein interfaceValue- Throws:
MappingException
getCollectionSemantics
getCollectionType
isNullable
public boolean isNullable()- Specified by:
isNullablein interfaceValue
isAlternateUniqueKey
public boolean isAlternateUniqueKey()- Specified by:
isAlternateUniqueKeyin interfaceValue
getTable
createForeignKey
public void createForeignKey()- Specified by:
createForeignKeyin interfaceValue
createUniqueKey
- Specified by:
createUniqueKeyin interfaceValue
isSimpleValue
public boolean isSimpleValue()- Specified by:
isSimpleValuein interfaceValue
isValid
isSame
isSame
isSame
createAllKeys
- Throws:
MappingException
getCacheConcurrencyStrategy
setCacheConcurrencyStrategy
setTypeUsingReflection
- Specified by:
setTypeUsingReflectionin 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:
addFilterin interfaceFilterable
getFilters
- Specified by:
getFiltersin 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
Deprecated, for removal: This API element is subject to removal in a future version.setTypeParameters
Deprecated, for removal: This API element is subject to removal in a future version.setTypeParameters
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
getComparatorClassName
getMappedByProperty
setMappedByProperty
isColumnInsertable
public boolean isColumnInsertable(int index) - Specified by:
isColumnInsertablein interfaceValue
isColumnUpdateable
public boolean isColumnUpdateable(int index) - Specified by:
isColumnUpdateablein interfaceValue
enableSoftDelete
Description copied from interface:SoftDeletableEnable soft-delete for this part of the model.- Specified by:
enableSoftDeletein interfaceSoftDeletable- Parameters:
indicatorColumn- The column which indicates soft-deletionstrategy- The strategy for indicating soft-deletion
getSoftDeleteStrategy
Description copied from interface:SoftDeletableThe strategy for indicating soft-deletion.- Specified by:
getSoftDeleteStrategyin interfaceSoftDeletable
getSoftDeleteColumn
Description copied from interface:SoftDeletableThe column which indicates soft-deletion.- Specified by:
getSoftDeleteColumnin interfaceSoftDeletable
getInsertExpectation
setInsertExpectation
getUpdateExpectation
setUpdateExpectation
getDeleteExpectation
setDeleteExpectation
getDeleteAllExpectation
setDeleteAllExpectation