Class UnionSubclassEntityPersister
- java.lang.Object
-
- org.hibernate.persister.entity.AbstractEntityPersister
-
- org.hibernate.persister.entity.UnionSubclassEntityPersister
-
- All Implemented Interfaces:
LazyPropertyInitializer,FetchProfileAffectee,PostInsertIdentityPersister,Loadable,ClassMetadata,Bindable,Discriminable,EntityMappingType,EntityValuedModelPart,FilterRestrictable,InFlightEntityMappingType,JdbcMappingContainer,ManagedMappingType,MappingModelExpressible,MappingType,ModelPart,ModelPartContainer,Restrictable,SoftDeletableModelPart,WhereRestrictable,DeprecatedEntityStuff,EntityPersister,Joinable,Loadable,Lockable,EntityMutationTarget,OuterJoinLoadable,PropertyMapping,Queryable,SQLLoadable,UniqueKeyLoadable,AttributeSource,RootTableGroupProducer,TableGroupProducer,MutationTarget<EntityTableMapping>,FetchableContainer
@Internal public class UnionSubclassEntityPersister extends AbstractEntityPersister
AnEntityPersisterimplementing theInheritanceType.TABLE_PER_CLASSmapping strategy for an entity and its inheritance hierarchy.This is implemented as a separate table for each concrete class, with all inherited attributes persisted as columns of that table.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.hibernate.persister.entity.AbstractEntityPersister
AbstractEntityPersister.CacheEntryHelper
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.Bindable
Bindable.JdbcValuesBiConsumer<X,Y>, Bindable.JdbcValuesConsumer
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.EntityMappingType
EntityMappingType.ConstraintOrderedTableConsumer
-
Nested classes/interfaces inherited from interface org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer
LazyPropertyInitializer.InterceptorImplementor
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.JdbcValueBiConsumer<X,Y>, ModelPart.JdbcValueConsumer
-
Nested classes/interfaces inherited from interface org.hibernate.persister.entity.Queryable
Queryable.Declarer
-
-
Field Summary
-
Fields inherited from class org.hibernate.persister.entity.AbstractEntityPersister
accessOptimizer, batchSize, customSQLDelete, customSQLInsert, customSQLUpdate, declaredAttributeMappings, deleteCallable, deleteExpectations, ENTITY_CLASS, fullDiscriminatorSQLValues, insertCallable, insertExpectations, insertGeneratedProperties, propertyMapping, rowIdName, staticFetchableList, updateCallable, updateExpectations, updateGeneratedProperties, VERSION_COLUMN_ALIAS
-
Fields inherited from interface org.hibernate.persister.entity.EntityPersister
ENTITY_ID
-
Fields inherited from interface org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer
UNFETCHED_PROPERTY
-
Fields inherited from interface org.hibernate.persister.entity.Loadable
ROWID_ALIAS
-
-
Constructor Summary
Constructors Constructor Description UnionSubclassEntityPersister(PersistentClass persistentClass, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy, RuntimeModelCreationContext creationContext)UnionSubclassEntityPersister(PersistentClass persistentClass, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy, PersisterCreationContext creationContext)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsTableReference(String tableExpression)UnionTableReferencecreatePrimaryTableReference(SqlAliasBase sqlAliasBase, SqlAstCreationState creationState)TableGroupcreateRootTableGroup(boolean canUseInnerJoins, NavigablePath navigablePath, String explicitSourceAlias, SqlAliasBase sqlAliasBase, Supplier<Consumer<Predicate>> additionalPredicateCollectorAccess, SqlAstCreationState creationState)Create a root TableGroup as defined by this producerStringfromTableFragment(String name)Get the main from table fragment, given a query alias.protected EntityDiscriminatorMappinggenerateDiscriminatorMapping(PersistentClass bootEntityDescriptor)protected StringgenerateSubquery(Map<String,EntityNameUse> entityNameUses)protected StringgenerateSubquery(PersistentClass model, Metadata mapping)StringgetAttributeMutationTableName(int attributeIndex)The name of the table to use when performing mutations (INSERT,UPDATE,DELETE) for the given attributeString[]getConstraintOrderedTableNameClosure()Get the names of all tables used in the hierarchy (up and down) ordered such that deletes in the given order would not cause constraint violations.String[][]getContraintOrderedTableKeyColumnClosure()For each table specified inQueryable.getConstraintOrderedTableNameClosure(), get the columns that define the key between the various hierarchy classes.StringgetDiscriminatorSQLValue()Get the discriminator value for this particular concrete subclass, as a string that may be embedded in a select statementBasicType<?>getDiscriminatorType()Get the discriminator typeObjectgetDiscriminatorValue()The discriminator value which indicates this entity mappingFilterAliasGeneratorgetFilterAliasGenerator(String rootAlias)TableDetailsgetIdentifierTableDetails()Details for the table that defines the identifier column(s) for an entity hierarchy.String[]getKeyColumns(int j)TableDetailsgetMappedTableDetails()Details for the table this entity maps.String[]getPropertySpaces()Returns an array of objects that identify spaces in which properties of this entity are persisted, for instances of this class only.protected int[]getPropertyTableNumbers()Serializable[]getQuerySpaces()Returns an array of objects that identify spaces in which properties of this entity are persisted, for instances of this class and its subclasses.StringgetRootTableName()Locks are always applied to the "root table".Map<Object,String>getSubclassByDiscriminatorValue()StringgetSubclassForDiscriminatorValue(Object value)Get the concrete subclass corresponding to the given discriminator valueStringgetSubclassPropertyTableName(int i)Return the table name used to persist the numbered property of the class or a subclass.protected intgetSubclassPropertyTableNumber(int i)intgetSubclassPropertyTableNumber(String propertyName)Warning: When there are duplicated property names in the subclasses of the class, this method may return the wrong table number for the duplicated subclass property (note that SingleTableEntityPersister defines an overloaded form which takes the entity name.protected String[]getSubclassTableKeyColumns(int j)StringgetSubclassTableName(int j)Get the name of the table with the given index from the internal array.protected String[]getSubclassTableNames()intgetSubclassTableSpan()protected boolean[]getTableHasColumns()StringgetTableName()The table to join to.StringgetTableName(int j)intgetTableSpan()booleanhasDuplicateTables()protected booleanhasMultipleTables()protected booleanisClassOrSuperclassTable(int j)protected booleanisIdentifierTable(String tableExpression)protected booleanisPhysicalDiscriminator()booleanisPropertyOfTable(int property, int j)booleanisTableCascadeDeleteEnabled(int j)booleanneedsDiscriminator()StringphysicalTableNameForMutation(SelectableMapping selectableMapping)Unfortunately we cannot directly use `SelectableMapping#getContainingTableExpression()` as that blows up for attributes declared on super-type for union-subclass mappingsvoidpruneForSubclasses(TableGroup tableGroup, Map<String,EntityNameUse> entityNameUses)Adapts the table group and its table reference as well as table reference joins in a way such that unnecessary tables or joins are omitted if possible, based on the given treated entity names.protected booleanshouldProcessSuperMapping()protected voidvalidateGenerator()voidvisitConstraintOrderedTables(EntityMappingType.ConstraintOrderedTableConsumer consumer)protected voidvisitMutabilityOrderedTables(org.hibernate.persister.entity.AbstractEntityPersister.MutabilityOrderedTableConsumer consumer)Visit details about each table for this entity, using "mutability ordering".-
Methods inherited from class org.hibernate.persister.entity.AbstractEntityPersister
addDiscriminatorToInsertGroup, addSoftDeleteToInsertGroup, afterInitialize, afterReassociate, applyBaseRestrictions, applyDiscriminator, applyFilterRestrictions, applySqlSelections, applySqlSelections, applyWhereRestrictions, buildCacheEntry, buildCacheEntryHelper, buildDeleteCoordinator, buildEmbeddedAttributeMapping, buildInsertCoordinator, buildMergeCoordinator, buildMultiIdLoader, buildPluralAttributeMapping, buildSingleIdEntityLoader, buildSingularAssociationAttributeMapping, buildTableMappings, buildUpdateCoordinator, canReadFromCache, canUseReferenceCacheEntries, canWriteToCache, check, checkVersion, consumesCollectionAlias, consumesEntityAlias, countSubclassProperties, createDomainResult, createGeneratedValuesProcessor, createInsertDelegate, createProxy, createTableReferenceJoin, createUpdateDelegate, dehydrate, delete, determineLoaderToUse, determineTableName, determineTableNumberForColumn, disassemble, findAttributeMapping, findDeclaredAttributeMapping, findDirty, findModified, findSubPart, findSubTypesSubPart, forceVersionIncrement, forceVersionIncrement, forEachAttributeMapping, forEachAttributeMapping, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachMutableTable, forEachMutableTableReverse, forEachSelectable, generateDeleteString, generateFilterConditionAlias, generateIdentifierMapping, generateJoinPredicate, generateLocker, generateNaturalIdMapping, generateNonEncapsulatedCompositeIdentifierMapping, generateNonIdAttributeMapping, generateSelectVersionString, generateSQLDeleteStrings, generateTableAlias, generateTableReferenceJoin, generateVersionMapping, generateVersionMapping, getAttributeMapping, getAttributeMappings, getBatchSize, getBytecodeEnhancementMetadata, getCacheAccessStrategy, getCacheEntryStructure, getCascadeStyle, getClassMetadata, getCollectionKey, getConcreteProxyClass, getCurrentVersion, getDatabaseSnapshot, getDeclaredAttributeMappings, getDeleteCoordinator, getDiscriminatorAlias, getDiscriminatorAlias, getDiscriminatorColumnName, getDiscriminatorColumnReaders, getDiscriminatorColumnReaderTemplate, getDiscriminatorFormulaTemplate, getDiscriminatorMapping, getElementTypeDescriptor, getEntityEntryFactory, getEntityMetamodel, getEntityName, getEntityNameByTableNameMap, getEntityPersister, getEntityType, getFactory, getFetchable, getFetchMode, getGenerator, getIdByUniqueKey, getIdentifier, getIdentifier, getIdentifierAliases, getIdentifierAliases, getIdentifierColumnNames, getIdentifierColumnReaders, getIdentifierColumnReaderTemplates, getIdentifierColumnSpan, getIdentifierDescriptor, getIdentifierGenerator, getIdentifierMapping, getIdentifierPropertyName, getIdentifierTableMapping, getIdentifierTableName, getIdentifierType, getIdentitySelectString, getInsertCoordinator, getInsertDelegate, getInsertGeneratedProperties, getInsertGeneratedValuesProcessor, getInstrumentationMetadata, getJdbcMapping, getJdbcTypeCount, getKeyColumnNames, getKeyFetchable, getLazyLoadPlanByFetchGroup, getLazyPropertyColumnAliases, getMappedClass, getMappedJavaType, getMappedSuperclass, getMergeCoordinator, getMultiNaturalIdLoader, getName, getNaturalIdCacheAccessStrategy, getNaturalIdentifierProperties, getNaturalIdentifierSnapshot, getNaturalIdLoader, getNaturalIdMapping, getNavigableRole, getNonLazyPropertyUpdateability, getNumberOfAttributeMappings, getNumberOfDeclaredAttributeMappings, getNumberOfFetchableKeys, getNumberOfFetchables, getNumberOfKeyFetchables, getPartName, getPhysicalTableMappingForMutation, getPropertyAliases, getPropertyCascadeStyles, getPropertyCheckability, getPropertyColumnInsertable, getPropertyColumnNames, getPropertyColumnNames, getPropertyColumnSpan, getPropertyColumnUpdateable, getPropertyColumnWriters, getPropertyIndex, getPropertyInsertability, getPropertyLaziness, getPropertyNames, getPropertyNullability, getPropertySpan, getPropertyTableName, getPropertyType, getPropertyTypes, getPropertyUpdateability, getPropertyUpdateability, getPropertyValue, getPropertyValue, getPropertyValues, getPropertyValuesToInsert, getPropertyVersionability, getPrunedDiscriminatorPredicate, getRepresentationStrategy, getRootEntityName, getRootTableAlias, getRootTableIdentifierColumnNames, getRootTableKeyColumnNames, getRowIdMapping, getSelectByUniqueKeyString, getSelectByUniqueKeyString, getSelectByUniqueKeyString, getSingleIdLoader, getSoftDeleteMapping, getSoftDeleteTableDetails, getSqlAliasStem, getSQLDeleteStrings, getSQLUpdateStrings, getSqlWhereStringTableExpression, getSqmMultiTableInsertStrategy, getSqmMultiTableMutationStrategy, getStateArrayInitialPosition, getStaticFetchableList, getSubclassColumnAliasClosure, getSubclassEntityPersister, getSubclassFormulaAliasClosure, getSubclassPropertyColumnAliases, getSubclassPropertyColumnNameClosure, getSubclassPropertyColumnNames, getSubclassPropertyColumnNames, getSubclassPropertyColumnReaderClosure, getSubclassPropertyColumnReaderTemplateClosure, getSubclassPropertyDeclarer, getSubclassPropertyFormulaTemplateClosure, getSubclassPropertyName, getSubclassPropertyNameClosure, getSubclassPropertyType, getSubclassPropertyTypeClosure, getSubMappingTypes, getSuperMappingType, getTableAliasForColumn, getTableId, getTableMapping, getTableMappings, getTableMappingsCount, getTableNames, getTableUpdateNeeded, getTargetPart, getType, getTypeDiscriminatorMetadata, getUniqueKeyLoader, getUpdateCoordinator, getUpdateDelegate, getUpdateGeneratedProperties, getUpdateGeneratedValuesProcessor, getVersion, getVersionColumnName, getVersionedTableName, getVersionGenerator, getVersionMapping, getVersionProperty, getVersionSelectString, getVersionType, hasAnySkippableTables, hasCache, hasCascadeDelete, hasCascades, hasCollectionNotReferencingPK, hasCollections, hasFilterForLoadByKey, hasFormulaProperties, hasIdentifierProperty, hasInsertGeneratedProperties, hasLazyDirtyFields, hasLazyProperties, hasMutableProperties, hasNaturalIdCache, hasNaturalIdentifier, hasOwnedCollections, hasPartitionedSelectionMapping, hasProxy, hasRowId, hasSkippableTables, hasSubclasses, hasSubselectLoadableCollections, hasUninitializedLazyProperties, hasUpdateGeneratedProperties, hasWhereRestrictions, implementsLifecycle, initializeEnhancedEntityUsedAsProxy, initializeLazyPropertiesFromCache, initializeLazyPropertiesFromDatastore, initializeLazyProperty, initializeLazyProperty, initializeLazyProperty, initInsertGeneratedProperties, initPropertyPaths, initSubclassPropertyAliasesMap, initUpdateGeneratedProperties, instantiate, interpretSqmMultiTableInsertStrategy, interpretSqmMultiTableStrategy, isAbstract, isAffectedByEnabledFetchProfiles, isAffectedByEnabledFilters, isAffectedByEntityGraph, isAllNull, isAllOrDirtyOptLocking, isBatchable, isBatchLoadable, isCacheInvalidationRequired, isClassOrSuperclassJoin, isCollection, isConcreteProxy, isDefinedOnSubclass, isDeleteCallable, isDiscriminatorFormula, isExplicitPolymorphism, isIdentifierAssignedByInsert, isInherited, isInsertCallable, isInstance, isInstrumented, isInverseSubclassTable, isInverseTable, isLazyPropertiesCacheable, isMultiTable, isMutable, isNullableSubclassTable, isNullableTable, isPolymorphic, isPropertySelectable, isSelectable, isSelectBeforeUpdateRequired, isSharedColumn, isSubclassEntityName, isSubclassPropertyNullable, isSubclassTableIndicatedByTreatAsDeclarations, isSubclassTableSequentialSelect, isTransient, isTypeOrSuperType, isUpdateCallable, isVersioned, isVersionGeneratedBeforeExecution, isVersionGeneratedOnExecution, isVersionPropertyGenerated, isVersionPropertyInsertable, linkToSession, linkWithSubType, linkWithSuperType, load, load, load, loadByUniqueKey, loadByUniqueKey, loadEntityIdByNaturalId, lock, lock, logStaticSQL, multiLoad, optimisticLockStyle, postConstruct, postInstantiate, prepareLoaders, prepareMappingModel, processInsertGeneratedProperties, processUpdateGeneratedProperties, registerAffectingFetchProfile, resetIdentifier, resolveAttributeIndexes, resolveConcreteProxyTypeForId, resolveDirtyAttributeIndexes, resolveDiscriminatorType, selectFragment, setIdentifier, setPropertyValue, setPropertyValue, setPropertyValues, shouldGetAllProperties, shouldInnerJoinSubclassTable, storeDiscriminatorInShallowQueryCacheLayout, substituteBrackets, toColumns, toColumns, toString, toType, uniqueKeyEntries, useShallowQueryCacheLayout, verifyHasNaturalId, visitAttributeMappings, visitDeclaredAttributeMappings, visitFetchables, visitFetchables, visitKeyFetchables, visitKeyFetchables, visitSubParts, visitSubTypeAttributeMappings, visitSuperTypeAttributeMappings
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue
-
Methods inherited from interface org.hibernate.metadata.ClassMetadata
getIdentifier, getIdentifier, getPropertyValuesToInsert, instantiate, setIdentifier
-
Methods inherited from interface org.hibernate.metamodel.mapping.EntityMappingType
asEntityMappingType, extractConcreteTypeStateValues, findContainingEntityMapping, findSubPart, getContributor, getIdentifierMappingForJoin, getJavaType, getPartMappingType, getRootEntityDescriptor, getRootPathName, getSubclassEntityNames, getSubclassId, isTypeOrSuperType, pruneForSubclasses
-
Methods inherited from interface org.hibernate.persister.entity.mutation.EntityMutationTarget
getIdentityInsertDelegate, getMutationDelegate
-
Methods inherited from interface org.hibernate.persister.entity.EntityPersister
addToCacheKey, breakDownJdbcValues, canExtractIdOutOfEntity, getEntityMappingType, getFilterAliasGenerator, getGeneratedProperties, getSynchronizationSpaces, getSynchronizedQuerySpaces, getValue, getValues, getVersionJavaType, insert, insert, load, merge, processInsertGeneratedProperties, processUpdateGeneratedProperties, setValue, setValues, update, visitQuerySpaces
-
Methods inherited from interface org.hibernate.metamodel.mapping.EntityValuedModelPart
forEachSubPart
-
Methods inherited from interface org.hibernate.sql.results.graph.FetchableContainer
getSelectableIndex, visitFetchables, visitKeyFetchables
-
Methods inherited from interface org.hibernate.metamodel.mapping.FilterRestrictable
applyFilterRestrictions
-
Methods inherited from interface org.hibernate.metamodel.mapping.JdbcMappingContainer
getSingleJdbcMapping
-
Methods inherited from interface org.hibernate.loader.ast.spi.Loadable
isAffectedByEnabledFilters, isAffectedByInfluencers, isAffectedByInfluencers, isNotAffectedByInfluencers
-
Methods inherited from interface org.hibernate.metamodel.mapping.ManagedMappingType
anyRequiresAggregateColumnWriter, isAffectedByEnabledFilters
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, asAttributeMapping, asBasicValuedModelPart, breakDownJdbcValues, decompose, decompose, forEachSelectable, isEntityIdentifierMapping, isVirtual
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPartContainer
findByPath, findByPath, forEachSubPart
-
Methods inherited from interface org.hibernate.sql.model.MutationTarget
getRolePath
-
Methods inherited from interface org.hibernate.metamodel.mapping.Restrictable
applyBaseRestrictions
-
-
-
-
Constructor Detail
-
UnionSubclassEntityPersister
@Deprecated(since="6.0") public UnionSubclassEntityPersister(PersistentClass persistentClass, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy, PersisterCreationContext creationContext) throws HibernateException
Deprecated.- Throws:
HibernateException
-
UnionSubclassEntityPersister
public UnionSubclassEntityPersister(PersistentClass persistentClass, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy, RuntimeModelCreationContext creationContext) throws HibernateException
- Throws:
HibernateException
-
-
Method Detail
-
validateGenerator
protected void validateGenerator()
-
containsTableReference
public boolean containsTableReference(String tableExpression)
- Specified by:
containsTableReferencein interfaceTableGroupProducer- Overrides:
containsTableReferencein classAbstractEntityPersister
-
createPrimaryTableReference
public UnionTableReference createPrimaryTableReference(SqlAliasBase sqlAliasBase, SqlAstCreationState creationState)
- Specified by:
createPrimaryTableReferencein interfaceEntityMappingType- Overrides:
createPrimaryTableReferencein classAbstractEntityPersister
-
createRootTableGroup
public TableGroup createRootTableGroup(boolean canUseInnerJoins, NavigablePath navigablePath, String explicitSourceAlias, SqlAliasBase sqlAliasBase, Supplier<Consumer<Predicate>> additionalPredicateCollectorAccess, SqlAstCreationState creationState)
Description copied from interface:RootTableGroupProducerCreate a root TableGroup as defined by this producer- Specified by:
createRootTableGroupin interfaceEntityMappingType- Specified by:
createRootTableGroupin interfaceRootTableGroupProducer- Overrides:
createRootTableGroupin classAbstractEntityPersister- Parameters:
canUseInnerJoins- Whether inner joins can be used when creating table-references within this groupnavigablePath- The overall NavigablePath for the rootexplicitSourceAlias- The alias, if one, explicitly provided by the application for this rootsqlAliasBase- A specific SqlAliasBase to use. May benullindicating one should be created using the SqlAliasBaseGenerator fromcreationStateadditionalPredicateCollectorAccess- Collector for additional predicates associated with this producercreationState- The creation state
-
needsDiscriminator
public boolean needsDiscriminator()
- Specified by:
needsDiscriminatorin classAbstractEntityPersister
-
getQuerySpaces
public Serializable[] getQuerySpaces()
Description copied from interface:EntityPersisterReturns an array of objects that identify spaces in which properties of this entity are persisted, for instances of this class and its subclasses.Much like
EntityPersister.getPropertySpaces(), except that here we include subclass entity spaces.- Specified by:
getQuerySpacesin interfaceEntityPersister- Overrides:
getQuerySpacesin classAbstractEntityPersister- Returns:
- The query spaces.
-
getRootTableName
public String getRootTableName()
Description copied from interface:LockableLocks are always applied to the "root table".- Specified by:
getRootTableNamein interfaceLockable- Overrides:
getRootTableNamein classAbstractEntityPersister- Returns:
- The root table name
-
getTableName
public String getTableName()
Description copied from interface:JoinableThe table to join to.
-
getDiscriminatorType
public BasicType<?> getDiscriminatorType()
Description copied from interface:LoadableGet the discriminator type- Specified by:
getDiscriminatorTypein interfaceLoadable- Specified by:
getDiscriminatorTypein classAbstractEntityPersister
-
getSubclassByDiscriminatorValue
public Map<Object,String> getSubclassByDiscriminatorValue()
- Specified by:
getSubclassByDiscriminatorValuein classAbstractEntityPersister
-
getMappedTableDetails
public TableDetails getMappedTableDetails()
Description copied from interface:EntityMappingTypeDetails for the table this entity maps. Generally this is the same asEntityMappingType.getIdentifierTableDetails(), though may be different for subtypes in joined andunion inheritance hierarchies
-
getIdentifierTableDetails
public TableDetails getIdentifierTableDetails()
Description copied from interface:EntityMappingTypeDetails for the table that defines the identifier column(s) for an entity hierarchy.
-
getDiscriminatorValue
public Object getDiscriminatorValue()
Description copied from interface:EntityMappingTypeThe discriminator value which indicates this entity mapping
-
getDiscriminatorSQLValue
public String getDiscriminatorSQLValue()
Description copied from interface:QueryableGet the discriminator value for this particular concrete subclass, as a string that may be embedded in a select statement
-
getSubclassForDiscriminatorValue
public String getSubclassForDiscriminatorValue(Object value)
Description copied from interface:LoadableGet the concrete subclass corresponding to the given discriminator value
-
getPropertySpaces
public String[] getPropertySpaces()
Description copied from interface:EntityPersisterReturns an array of objects that identify spaces in which properties of this entity are persisted, for instances of this class only.For most implementations, this returns the complete set of table names to which instances of the mapped entity are persisted (not accounting for superclass entity mappings).
- Returns:
- The property spaces.
-
shouldProcessSuperMapping
protected boolean shouldProcessSuperMapping()
- Overrides:
shouldProcessSuperMappingin classAbstractEntityPersister
-
hasDuplicateTables
public boolean hasDuplicateTables()
- Specified by:
hasDuplicateTablesin classAbstractEntityPersister
-
getTableName
public String getTableName(int j)
- Specified by:
getTableNamein classAbstractEntityPersister
-
getKeyColumns
public String[] getKeyColumns(int j)
- Specified by:
getKeyColumnsin classAbstractEntityPersister
-
isTableCascadeDeleteEnabled
public boolean isTableCascadeDeleteEnabled(int j)
- Specified by:
isTableCascadeDeleteEnabledin classAbstractEntityPersister
-
isPropertyOfTable
public boolean isPropertyOfTable(int property, int j)- Specified by:
isPropertyOfTablein classAbstractEntityPersister
-
fromTableFragment
public String fromTableFragment(String name)
Description copied from interface:OuterJoinLoadableGet the main from table fragment, given a query alias.
-
getSubclassPropertyTableName
public String getSubclassPropertyTableName(int i)
Description copied from interface:OuterJoinLoadableReturn the table name used to persist the numbered property of the class or a subclass.
-
getAttributeMutationTableName
public String getAttributeMutationTableName(int attributeIndex)
Description copied from interface:OuterJoinLoadableThe name of the table to use when performing mutations (INSERT,UPDATE,DELETE) for the given attribute
-
getSubclassPropertyTableNumber
protected int getSubclassPropertyTableNumber(int i)
- Specified by:
getSubclassPropertyTableNumberin classAbstractEntityPersister
-
getSubclassPropertyTableNumber
public int getSubclassPropertyTableNumber(String propertyName)
Description copied from class:AbstractEntityPersisterWarning: When there are duplicated property names in the subclasses of the class, this method may return the wrong table number for the duplicated subclass property (note that SingleTableEntityPersister defines an overloaded form which takes the entity name.- Specified by:
getSubclassPropertyTableNumberin interfaceQueryable- Overrides:
getSubclassPropertyTableNumberin classAbstractEntityPersister- Parameters:
propertyName- The name of the property.- Returns:
- The number of the table to which the property is mapped.
-
physicalTableNameForMutation
public String physicalTableNameForMutation(SelectableMapping selectableMapping)
Description copied from class:AbstractEntityPersisterUnfortunately we cannot directly use `SelectableMapping#getContainingTableExpression()` as that blows up for attributes declared on super-type for union-subclass mappings- Overrides:
physicalTableNameForMutationin classAbstractEntityPersister
-
isIdentifierTable
protected boolean isIdentifierTable(String tableExpression)
- Specified by:
isIdentifierTablein classAbstractEntityPersister
-
hasMultipleTables
protected boolean hasMultipleTables()
- Overrides:
hasMultipleTablesin classAbstractEntityPersister
-
pruneForSubclasses
public void pruneForSubclasses(TableGroup tableGroup, Map<String,EntityNameUse> entityNameUses)
Description copied from interface:EntityMappingTypeAdapts the table group and its table reference as well as table reference joins in a way such that unnecessary tables or joins are omitted if possible, based on the given treated entity names.The goal is to e.g. remove join inheritance "branches" or union selects that are impossible.
Consider the following example:
class BaseEntity {} class Sub1 extends BaseEntity {} class Sub1Sub1 extends Sub1 {} class Sub1Sub2 extends Sub1 {} class Sub2 extends BaseEntity {} class Sub2Sub1 extends Sub2 {} class Sub2Sub2 extends Sub2 {}If the
treatedEntityNamesonly containsSub1or any of its subtypes, this means thatSub2and all subtypes are impossible, thus the joins/selects for these types shall be omitted in the given table group.- Parameters:
tableGroup- The table group to prune subclass tables forentityNameUses- The entity names under which a table group was used.
-
visitConstraintOrderedTables
public void visitConstraintOrderedTables(EntityMappingType.ConstraintOrderedTableConsumer consumer)
-
visitMutabilityOrderedTables
protected void visitMutabilityOrderedTables(org.hibernate.persister.entity.AbstractEntityPersister.MutabilityOrderedTableConsumer consumer)
Description copied from class:AbstractEntityPersisterVisit details about each table for this entity, using "mutability ordering". When inserting rows, the order we go through the tables to avoid foreign key problems among the entity's group of tables.Used while building the table mapping descriptors for each table.
- Specified by:
visitMutabilityOrderedTablesin classAbstractEntityPersister- See Also:
AbstractEntityPersister.forEachMutableTable(java.util.function.Consumer<org.hibernate.persister.entity.mutation.EntityTableMapping>),AbstractEntityPersister.forEachMutableTableReverse(java.util.function.Consumer<org.hibernate.persister.entity.mutation.EntityTableMapping>)
-
isPhysicalDiscriminator
protected boolean isPhysicalDiscriminator()
- Overrides:
isPhysicalDiscriminatorin classAbstractEntityPersister
-
generateDiscriminatorMapping
protected EntityDiscriminatorMapping generateDiscriminatorMapping(PersistentClass bootEntityDescriptor)
- Overrides:
generateDiscriminatorMappingin classAbstractEntityPersister
-
getTableSpan
public int getTableSpan()
- Specified by:
getTableSpanin classAbstractEntityPersister
-
getTableHasColumns
protected boolean[] getTableHasColumns()
- Overrides:
getTableHasColumnsin classAbstractEntityPersister
-
getPropertyTableNumbers
protected int[] getPropertyTableNumbers()
- Specified by:
getPropertyTableNumbersin classAbstractEntityPersister
-
generateSubquery
protected String generateSubquery(PersistentClass model, Metadata mapping)
-
generateSubquery
protected String generateSubquery(Map<String,EntityNameUse> entityNameUses)
-
getSubclassTableKeyColumns
protected String[] getSubclassTableKeyColumns(int j)
- Specified by:
getSubclassTableKeyColumnsin classAbstractEntityPersister
-
getSubclassTableName
public String getSubclassTableName(int j)
Description copied from interface:QueryableGet the name of the table with the given index from the internal array.- Specified by:
getSubclassTableNamein interfaceQueryable- Specified by:
getSubclassTableNamein classAbstractEntityPersister- Parameters:
j- The index into the internal array.
-
getSubclassTableNames
protected String[] getSubclassTableNames()
- Specified by:
getSubclassTableNamesin classAbstractEntityPersister
-
getSubclassTableSpan
public int getSubclassTableSpan()
- Specified by:
getSubclassTableSpanin classAbstractEntityPersister
-
isClassOrSuperclassTable
protected boolean isClassOrSuperclassTable(int j)
- Specified by:
isClassOrSuperclassTablein classAbstractEntityPersister
-
getConstraintOrderedTableNameClosure
public String[] getConstraintOrderedTableNameClosure()
Description copied from interface:QueryableGet the names of all tables used in the hierarchy (up and down) ordered such that deletes in the given order would not cause constraint violations.- Returns:
- The ordered array of table names.
-
getContraintOrderedTableKeyColumnClosure
public String[][] getContraintOrderedTableKeyColumnClosure()
Description copied from interface:QueryableFor each table specified inQueryable.getConstraintOrderedTableNameClosure(), get the columns that define the key between the various hierarchy classes.The first dimension here corresponds to the table indexes returned in
Queryable.getConstraintOrderedTableNameClosure().The second dimension should have the same length across all the elements in the first dimension. If not, that would be a problem ;)
-
getFilterAliasGenerator
public FilterAliasGenerator getFilterAliasGenerator(String rootAlias)
-
-