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 Details

  • Constructor Details

  • Method Details

    • getBuildingContext

      public MetadataBuildingContext getBuildingContext()
      Specified by:
      getBuildingContext in interface Value
    • getMetadata

      public MetadataImplementor getMetadata()
    • getServiceRegistry

      public ServiceRegistry getServiceRegistry()
      Specified by:
      getServiceRegistry in interface Value
    • 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()
    • isLazy

      public boolean isLazy()
      Specified by:
      isLazy in interface Fetchable
    • setLazy

      public void setLazy(boolean lazy)
      Specified by:
      setLazy in interface Fetchable
    • 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 interface Value
    • 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 interface Fetchable
      Specified by:
      getFetchMode in interface Value
    • setFetchMode

      public void setFetchMode(FetchMode fetchMode)
      Specified by:
      setFetchMode in interface Fetchable
    • validate

      @Deprecated(since="7.0") public void validate(Mapping mapping) throws MappingException
      Deprecated.
      Throws:
      MappingException
    • validate

      public void validate(MappingContext mappingContext) throws MappingException
      Throws:
      MappingException
    • getSelectables

      public List<Selectable> getSelectables()
      Description copied from interface: Value
      The mapping to columns and formulas.
      Specified by:
      getSelectables in interface Value
    • getColumns

      public List<Column> getColumns()
      Description copied from interface: Value
      If the mapping involves only columns, return them.
      Specified by:
      getColumns in interface Value
    • getColumnSpan

      public int getColumnSpan()
      Description copied from interface: Value
      The number of columns and formulas in the mapping.
      Specified by:
      getColumnSpan in interface Value
    • getType

      public Type getType() throws MappingException
      Specified by:
      getType in interface Value
      Throws:
      MappingException
    • getCollectionSemantics

      public CollectionSemantics<?,?> getCollectionSemantics()
    • getCollectionType

      public CollectionType getCollectionType()
    • isNullable

      public boolean isNullable()
      Specified by:
      isNullable in interface Value
    • isAlternateUniqueKey

      public boolean isAlternateUniqueKey()
      Specified by:
      isAlternateUniqueKey in interface Value
    • getTable

      public Table getTable()
      Specified by:
      getTable in interface Value
    • createForeignKey

      public void createForeignKey()
      Specified by:
      createForeignKey in interface Value
    • createUniqueKey

      public void createUniqueKey(MetadataBuildingContext context)
      Specified by:
      createUniqueKey in interface Value
    • isSimpleValue

      public boolean isSimpleValue()
      Specified by:
      isSimpleValue in interface Value
    • isValid

      public boolean isValid(MappingContext mappingContext)
      Specified by:
      isValid in interface Value
    • isSame

      public boolean isSame(Value other)
      Specified by:
      isSame in interface Value
    • isSame

      protected static boolean isSame(Value v1, Value v2)
    • 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 interface Value
    • 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()
    • setCustomSQLUpdate

      public void setCustomSQLUpdate(String customSQLUpdate, boolean callable, ExecuteUpdateResultCheckStyle checkStyle)
    • getCustomSQLUpdate

      public String getCustomSQLUpdate()
    • isCustomUpdateCallable

      public boolean isCustomUpdateCallable()
    • setCustomSQLDelete

      public void setCustomSQLDelete(String customSQLDelete, boolean callable, ExecuteUpdateResultCheckStyle checkStyle)
    • getCustomSQLDelete

      public String getCustomSQLDelete()
    • isCustomDeleteCallable

      public boolean isCustomDeleteCallable()
    • 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 interface Filterable
    • getFilters

      public List<FilterConfiguration> getFilters()
      Specified by:
      getFilters in interface Filterable
    • addManyToManyFilter

      public void addManyToManyFilter(String name, String condition, boolean autoAliasInjection, Map<String,String> aliasTableMap, Map<String,String> aliasEntityMap)
    • getManyToManyFilters

      public List<FilterConfiguration> getManyToManyFilters()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getSynchronizedTables

      public Set<String> getSynchronizedTables()
    • 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 interface Value
    • hasAnyInsertableColumns

      public boolean hasAnyInsertableColumns()
      Specified by:
      hasAnyInsertableColumns in interface Value
    • getColumnUpdateability

      public boolean[] getColumnUpdateability()
      Specified by:
      getColumnUpdateability in interface Value
    • hasAnyUpdatableColumns

      public boolean hasAnyUpdatableColumns()
      Specified by:
      hasAnyUpdatableColumns in interface Value
    • 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 interface Value
    • isColumnUpdateable

      public boolean isColumnUpdateable(int index)
      Specified by:
      isColumnUpdateable in interface Value
    • enableSoftDelete

      public void enableSoftDelete(Column indicatorColumn)
      Specified by:
      enableSoftDelete in interface SoftDeletable
    • getSoftDeleteColumn

      public Column getSoftDeleteColumn()
      Specified by:
      getSoftDeleteColumn in interface SoftDeletable
    • 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)