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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_ELEMENT_COLUMN_NAME
static String
DEFAULT_KEY_COLUMN_NAME
-
Constructor Summary
Constructors Modifier Constructor Description protected
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
-
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<? extends UserCollectionType>> customTypeBeanResolver, PersistentClass owner, MetadataBuildingContext buildingContext)
Annotation binding
-
Collection
protected Collection(Collection original)
-
-
Method Detail
-
getBuildingContext
public MetadataBuildingContext getBuildingContext()
- Specified by:
getBuildingContext
in interfaceValue
-
getMetadata
public MetadataImplementor getMetadata()
-
getServiceRegistry
public ServiceRegistry getServiceRegistry()
- Specified by:
getServiceRegistry
in 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() throws MappingException
- 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
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:
getFetchMode
in interfaceFetchable
- Specified by:
getFetchMode
in interfaceValue
-
setFetchMode
public void setFetchMode(FetchMode fetchMode)
- Specified by:
setFetchMode
in interfaceFetchable
-
setCollectionPersisterClass
public void setCollectionPersisterClass(Class<? extends CollectionPersister> persister)
-
getCollectionPersisterClass
public Class<? extends CollectionPersister> getCollectionPersisterClass()
-
validate
public void validate(Mapping mapping) throws MappingException
- Throws:
MappingException
-
getSelectables
public List<Selectable> getSelectables()
Description copied from interface:Value
The mapping to columns and formulas.- Specified by:
getSelectables
in interfaceValue
-
getColumns
public List<Column> 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
public Type getType() throws MappingException
- Specified by:
getType
in interfaceValue
- Throws:
MappingException
-
getCollectionSemantics
public CollectionSemantics<?,?> getCollectionSemantics()
-
getCollectionType
public CollectionType getCollectionType()
-
isNullable
public boolean isNullable()
- Specified by:
isNullable
in interfaceValue
-
isAlternateUniqueKey
public boolean isAlternateUniqueKey()
- Specified by:
isAlternateUniqueKey
in interfaceValue
-
createForeignKey
public void createForeignKey()
- Specified by:
createForeignKey
in interfaceValue
-
createUniqueKey
public void createUniqueKey(MetadataBuildingContext context)
- Specified by:
createUniqueKey
in interfaceValue
-
isSimpleValue
public boolean isSimpleValue()
- Specified by:
isSimpleValue
in interfaceValue
-
isSame
public boolean isSame(Collection other)
-
createAllKeys
public void createAllKeys() throws MappingException
- Throws:
MappingException
-
getCacheConcurrencyStrategy
public String getCacheConcurrencyStrategy()
-
setCacheConcurrencyStrategy
public void setCacheConcurrencyStrategy(String cacheConcurrencyStrategy)
-
setTypeUsingReflection
public void setTypeUsingReflection(String className, String propertyName)
- Specified by:
setTypeUsingReflection
in 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:
addFilter
in interfaceFilterable
-
getFilters
public List<FilterConfiguration> getFilters()
- Specified by:
getFilters
in 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:
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
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:
isColumnInsertable
in interfaceValue
-
isColumnUpdateable
public boolean isColumnUpdateable(int index)
- Specified by:
isColumnUpdateable
in interfaceValue
-
enableSoftDelete
public void enableSoftDelete(Column indicatorColumn)
- Specified by:
enableSoftDelete
in interfaceSoftDeletable
-
getSoftDeleteColumn
public Column getSoftDeleteColumn()
- Specified by:
getSoftDeleteColumn
in interfaceSoftDeletable
-
getInsertExpectation
public Supplier<? extends Expectation> getInsertExpectation()
-
setInsertExpectation
public void setInsertExpectation(Supplier<? extends Expectation> insertExpectation)
-
getUpdateExpectation
public Supplier<? extends Expectation> getUpdateExpectation()
-
setUpdateExpectation
public void setUpdateExpectation(Supplier<? extends Expectation> updateExpectation)
-
getDeleteExpectation
public Supplier<? extends Expectation> getDeleteExpectation()
-
setDeleteExpectation
public void setDeleteExpectation(Supplier<? extends Expectation> deleteExpectation)
-
getDeleteAllExpectation
public Supplier<? extends Expectation> getDeleteAllExpectation()
-
setDeleteAllExpectation
public void setDeleteAllExpectation(Supplier<? extends Expectation> deleteAllExpectation)
-
-