Class JoinedSubclassEntityPersister
- 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
EntityPersister
implementing the normalized
InheritanceType.JOINED
inheritance
mapping strategy for an entity and its inheritance hierarchy.
This is implemented as a separate table for each subclass, with only declared attributes persisted as columns of that table. Thus, each instance of a subclass has its state stored across rows of multiple tables.
-
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
ConstructorDescriptionJoinedSubclassEntityPersister
(PersistentClass persistentClass, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy, RuntimeModelCreationContext creationContext) JoinedSubclassEntityPersister
(PersistentClass persistentClass, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy, PersisterCreationContext creationContext) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDiscriminatorToInsertGroup
(MutationGroupBuilder insertGroupBuilder) int
determineTableNumberForColumn
(String columnName) forceVersionIncrement
(Object id, Object currentVersion, boolean batching, SharedSessionContractImplementor session) forceVersionIncrement
(Object id, Object currentVersion, SharedSessionContractImplementor session) fromTableFragment
(String alias) Get the main from table fragment, given a query alias.protected EntityDiscriminatorMapping
generateDiscriminatorMapping
(PersistentClass bootEntityDescriptor) generateFilterConditionAlias
(String rootAlias) The alias used for any filter conditions (mapped where-fragments or enabled-filters).protected EntityIdentifierMapping
generateIdentifierMapping
(Supplier<?> templateInstanceCreator, PersistentClass bootEntityDescriptor, MappingModelCreationProcess creationProcess) protected EntityIdentifierMapping
generateNonEncapsulatedCompositeIdentifierMapping
(MappingModelCreationProcess creationProcess, PersistentClass bootEntityDescriptor) protected EntityVersionMapping
generateVersionMapping
(Supplier<?> templateInstanceCreator, PersistentClass bootEntityDescriptor, MappingModelCreationProcess creationProcess) String[]
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[][]
For each table specified inQueryable.getConstraintOrderedTableNameClosure()
, get the columns that define the key between the various hierarchy classes.Get the discriminator value for this particular concrete subclass, as a string that may be embedded in a select statementBasicType<?>
Get the discriminator typeThe discriminator value which indicates this entity mappinggetFilterAliasGenerator
(String rootAlias) String[]
Get the names of columns used to persist the identifierString[]
String[]
Details for the table that defines the identifier column(s) for an entity hierarchy.String[]
getKeyColumns
(int j) Details for the table this entity maps.String[]
Returns an array of objects that identify spaces in which properties of this entity are persisted, for instances of this class only.protected int[]
getRootTableAlias
(String drivingAlias) Get the SQL alias this persister would use for the root table given the passed driving alias.Locks are always applied to the "root table".Get the concrete subclass corresponding to the given discriminator valuegetSubclassPropertyDeclarer
(String propertyPath) Determine whether the given property is declared by our mapped class, our super class, or one of our subclasses...getSubclassPropertyTableName
(int i) Return the table name used to persist the numbered property of the class or a subclass.protected int
protected String[]
getSubclassTableKeyColumns
(int j) getSubclassTableName
(int j) Get the name of the table with the given index from the internal array.protected String[]
int
The table to join to.getTableName
(int j) int
boolean
protected boolean
boolean
Whether this target defines any potentially skippable tables.protected boolean
isClassOrSuperclassTable
(int j) protected boolean
isIdentifierTable
(String tableExpression) protected boolean
isInverseSubclassTable
(int j) boolean
isInverseTable
(int j) protected boolean
isNullableSubclassTable
(int j) boolean
isNullableTable
(int j) protected boolean
boolean
isPropertyOfTable
(int property, int j) protected boolean
isSubclassTableIndicatedByTreatAsDeclarations
(int subclassTableNumber, Set<String> treatAsDeclarations) boolean
isTableCascadeDeleteEnabled
(int j) boolean
void
pruneForSubclasses
(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 boolean
void
protected void
visitMutabilityOrderedTables
(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
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, containsTableReference, countSubclassProperties, createDomainResult, createGeneratedValuesProcessor, createInsertDelegate, createPrimaryTableReference, createProxy, createRootTableGroup, createTableReferenceJoin, createUpdateDelegate, dehydrate, delete, determineLoaderToUse, determineTableName, disassemble, findAttributeMapping, findDeclaredAttributeMapping, findDirty, findModified, findSubPart, findSubTypesSubPart, forEachAttributeMapping, forEachAttributeMapping, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachMutableTable, forEachMutableTableReverse, forEachSelectable, generateDeleteString, generateJoinPredicate, generateLocker, generateNaturalIdMapping, generateNonIdAttributeMapping, generateSelectVersionString, generateSQLDeleteStrings, generateTableAlias, generateTableReferenceJoin, generateVersionMapping, getAttributeMapping, getAttributeMappings, getBatchSize, getBytecodeEnhancementMetadata, getCacheAccessStrategy, getCacheEntryStructure, getCascadeStyle, getClassMetadata, getCollectionKey, getConcreteProxyClass, getCurrentVersion, getDatabaseSnapshot, getDeclaredAttributeMappings, getDeleteCoordinator, getDiscriminatorAlias, getDiscriminatorFormulaTemplate, getDiscriminatorMapping, getElementTypeDescriptor, getEntityEntryFactory, getEntityMetamodel, getEntityName, getEntityNameByTableNameMap, getEntityPersister, getEntityType, getFactory, getFetchable, getFetchMode, getGenerator, getIdByUniqueKey, getIdentifier, getIdentifierAliases, getIdentifierAliases, 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, getQuerySpaces, getRepresentationStrategy, getRootEntityName, 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, getSubclassPropertyFormulaTemplateClosure, getSubclassPropertyName, getSubclassPropertyNameClosure, getSubclassPropertyTableNumber, getSubclassPropertyType, getSubclassPropertyTypeClosure, getSubMappingTypes, getSuperMappingType, getTableAliasForColumn, getTableHasColumns, 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, hasSubclasses, hasSubselectLoadableCollections, hasUninitializedLazyProperties, hasUpdateGeneratedProperties, hasWhereRestrictions, implementsLifecycle, initializeEnhancedEntityUsedAsProxy, initializeLazyPropertiesFromCache, initializeLazyPropertiesFromDatastore, 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, isLazyPropertiesCacheable, isMultiTable, isMutable, isPolymorphic, isPropertySelectable, isSelectable, isSelectBeforeUpdateRequired, isSharedColumn, isSubclassEntityName, isSubclassPropertyNullable, isSubclassTableSequentialSelect, isTransient, isTypeOrSuperType, isUpdateCallable, isVersioned, isVersionGeneratedBeforeExecution, isVersionGeneratedOnExecution, isVersionPropertyGenerated, isVersionPropertyInsertable, linkToSession, linkWithSubType, linkWithSuperType, load, load, load, loadByUniqueKey, loadByUniqueKey, loadEntityIdByNaturalId, lock, lock, logStaticSQL, multiLoad, optimisticLockStyle, physicalTableNameForMutation, 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, 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.persister.entity.OuterJoinLoadable
getAttributeMutationTableName
Methods inherited from interface org.hibernate.metamodel.mapping.Restrictable
applyBaseRestrictions
-
Constructor Details
-
JoinedSubclassEntityPersister
@Deprecated(since="6.0") public JoinedSubclassEntityPersister(PersistentClass persistentClass, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy, PersisterCreationContext creationContext) throws HibernateException Deprecated.- Throws:
HibernateException
-
JoinedSubclassEntityPersister
public JoinedSubclassEntityPersister(PersistentClass persistentClass, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy, RuntimeModelCreationContext creationContext) throws HibernateException - Throws:
HibernateException
-
-
Method Details
-
getSubclassByDiscriminatorValue
- Specified by:
getSubclassByDiscriminatorValue
in classAbstractEntityPersister
-
needsDiscriminator
public boolean needsDiscriminator()- Specified by:
needsDiscriminator
in classAbstractEntityPersister
-
isNullableTable
public boolean isNullableTable(int j) - Overrides:
isNullableTable
in classAbstractEntityPersister
-
visitMutabilityOrderedTables
protected void visitMutabilityOrderedTables(org.hibernate.persister.entity.AbstractEntityPersister.MutabilityOrderedTableConsumer consumer) Description copied from class:AbstractEntityPersister
Visit 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:
visitMutabilityOrderedTables
in classAbstractEntityPersister
- See Also:
-
isIdentifierTable
- Specified by:
isIdentifierTable
in classAbstractEntityPersister
-
hasSkippableTables
public boolean hasSkippableTables()Description copied from interface:EntityMutationTarget
Whether this target defines any potentially skippable tables.A table is considered potentially skippable if it is defined as inverse or as optional.
- Specified by:
hasSkippableTables
in interfaceEntityMutationTarget
- Overrides:
hasSkippableTables
in classAbstractEntityPersister
- See Also:
-
isInverseTable
public boolean isInverseTable(int j) - Overrides:
isInverseTable
in classAbstractEntityPersister
-
getSubclassPropertyTableName
Description copied from interface:OuterJoinLoadable
Return the table name used to persist the numbered property of the class or a subclass. -
isInverseSubclassTable
protected boolean isInverseSubclassTable(int j) - Overrides:
isInverseSubclassTable
in classAbstractEntityPersister
-
isNullableSubclassTable
protected boolean isNullableSubclassTable(int j) - Overrides:
isNullableSubclassTable
in classAbstractEntityPersister
-
getDiscriminatorType
Description copied from interface:Loadable
Get the discriminator type- Specified by:
getDiscriminatorType
in interfaceLoadable
- Specified by:
getDiscriminatorType
in classAbstractEntityPersister
-
getDiscriminatorValue
Description copied from interface:EntityMappingType
The discriminator value which indicates this entity mapping -
getDiscriminatorSQLValue
Description copied from interface:Queryable
Get the discriminator value for this particular concrete subclass, as a string that may be embedded in a select statement -
getDiscriminatorColumnName
- Specified by:
getDiscriminatorColumnName
in interfaceLoadable
- Overrides:
getDiscriminatorColumnName
in classAbstractEntityPersister
- Returns:
- the column name for the discriminator as specified in the mapping.
-
getDiscriminatorColumnReaders
- Overrides:
getDiscriminatorColumnReaders
in classAbstractEntityPersister
-
getDiscriminatorColumnReaderTemplate
- Overrides:
getDiscriminatorColumnReaderTemplate
in classAbstractEntityPersister
-
getDiscriminatorAlias
- Overrides:
getDiscriminatorAlias
in classAbstractEntityPersister
-
getSubclassForDiscriminatorValue
Description copied from interface:Loadable
Get the concrete subclass corresponding to the given discriminator value -
addDiscriminatorToInsertGroup
- Overrides:
addDiscriminatorToInsertGroup
in classAbstractEntityPersister
-
getPropertySpaces
Description copied from interface:EntityPersister
Returns 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.
-
hasDuplicateTables
public boolean hasDuplicateTables()- Specified by:
hasDuplicateTables
in classAbstractEntityPersister
-
getTableName
- Specified by:
getTableName
in classAbstractEntityPersister
-
getKeyColumns
- Specified by:
getKeyColumns
in classAbstractEntityPersister
-
isTableCascadeDeleteEnabled
public boolean isTableCascadeDeleteEnabled(int j) - Specified by:
isTableCascadeDeleteEnabled
in classAbstractEntityPersister
-
isPropertyOfTable
public boolean isPropertyOfTable(int property, int j) - Specified by:
isPropertyOfTable
in classAbstractEntityPersister
-
fromTableFragment
Description copied from interface:OuterJoinLoadable
Get the main from table fragment, given a query alias. -
getTableName
Description copied from interface:Joinable
The table to join to. -
generateFilterConditionAlias
Description copied from interface:Queryable
The alias used for any filter conditions (mapped where-fragments or enabled-filters).This may or may not be different from the root alias depending upon the inheritance mapping strategy.
- Specified by:
generateFilterConditionAlias
in interfaceQueryable
- Overrides:
generateFilterConditionAlias
in classAbstractEntityPersister
- Parameters:
rootAlias
- The root alias- Returns:
- The alias used for "filter conditions" within the where clause.
-
getIdentifierColumnNames
Description copied from interface:Loadable
Get the names of columns used to persist the identifier- Specified by:
getIdentifierColumnNames
in interfaceEntityPersister
- Specified by:
getIdentifierColumnNames
in interfaceLoadable
- Specified by:
getIdentifierColumnNames
in interfacePostInsertIdentityPersister
- Specified by:
getIdentifierColumnNames
in interfaceQueryable
- Overrides:
getIdentifierColumnNames
in classAbstractEntityPersister
-
getIdentifierColumnReaderTemplates
- Overrides:
getIdentifierColumnReaderTemplates
in classAbstractEntityPersister
-
getRootTableName
Description copied from interface:Lockable
Locks are always applied to the "root table".- Specified by:
getRootTableName
in interfaceLockable
- Overrides:
getRootTableName
in classAbstractEntityPersister
- Returns:
- The root table name
-
getIdentifierColumnReaders
- Overrides:
getIdentifierColumnReaders
in classAbstractEntityPersister
-
getSubclassPropertyTableNumber
protected int getSubclassPropertyTableNumber(int i) - Specified by:
getSubclassPropertyTableNumber
in classAbstractEntityPersister
-
getTableSpan
public int getTableSpan()- Specified by:
getTableSpan
in classAbstractEntityPersister
-
hasMultipleTables
protected boolean hasMultipleTables()- Overrides:
hasMultipleTables
in classAbstractEntityPersister
-
getPropertyTableNumbers
protected int[] getPropertyTableNumbers()- Specified by:
getPropertyTableNumbers
in classAbstractEntityPersister
-
getSubclassTableKeyColumns
- Specified by:
getSubclassTableKeyColumns
in classAbstractEntityPersister
-
getSubclassTableName
Description copied from interface:Queryable
Get the name of the table with the given index from the internal array.- Specified by:
getSubclassTableName
in interfaceQueryable
- Specified by:
getSubclassTableName
in classAbstractEntityPersister
- Parameters:
j
- The index into the internal array.
-
getSubclassTableNames
- Specified by:
getSubclassTableNames
in classAbstractEntityPersister
-
getSubclassTableSpan
public int getSubclassTableSpan()- Specified by:
getSubclassTableSpan
in classAbstractEntityPersister
-
shouldProcessSuperMapping
protected boolean shouldProcessSuperMapping()- Overrides:
shouldProcessSuperMapping
in classAbstractEntityPersister
-
isClassOrSuperclassTable
protected boolean isClassOrSuperclassTable(int j) - Specified by:
isClassOrSuperclassTable
in classAbstractEntityPersister
-
isSubclassTableIndicatedByTreatAsDeclarations
protected boolean isSubclassTableIndicatedByTreatAsDeclarations(int subclassTableNumber, Set<String> treatAsDeclarations) - Overrides:
isSubclassTableIndicatedByTreatAsDeclarations
in classAbstractEntityPersister
-
getConstraintOrderedTableNameClosure
Description copied from interface:Queryable
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.- Returns:
- The ordered array of table names.
-
getContraintOrderedTableKeyColumnClosure
Description copied from interface:Queryable
For 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 ;)
-
getRootTableAlias
Description copied from interface:Lockable
Get the SQL alias this persister would use for the root table given the passed driving alias.- Specified by:
getRootTableAlias
in interfaceLockable
- Overrides:
getRootTableAlias
in classAbstractEntityPersister
- Parameters:
drivingAlias
- The driving alias; or the alias for the table mapped by this persister in the hierarchy.- Returns:
- The root table alias.
-
getSubclassPropertyDeclarer
Description copied from interface:Queryable
Determine whether the given property is declared by our mapped class, our super class, or one of our subclasses...Note: the method is called 'subclass property...' simply for consistency sake (e.g.
Queryable.getSubclassPropertyTableNumber(java.lang.String)
- Specified by:
getSubclassPropertyDeclarer
in interfaceQueryable
- Overrides:
getSubclassPropertyDeclarer
in classAbstractEntityPersister
- Parameters:
propertyPath
- The property name.- Returns:
- The property declarer
-
determineTableNumberForColumn
- Overrides:
determineTableNumberForColumn
in classAbstractEntityPersister
-
generateVersionMapping
protected EntityVersionMapping generateVersionMapping(Supplier<?> templateInstanceCreator, PersistentClass bootEntityDescriptor, MappingModelCreationProcess creationProcess) - Overrides:
generateVersionMapping
in classAbstractEntityPersister
-
generateIdentifierMapping
protected EntityIdentifierMapping generateIdentifierMapping(Supplier<?> templateInstanceCreator, PersistentClass bootEntityDescriptor, MappingModelCreationProcess creationProcess) - Overrides:
generateIdentifierMapping
in classAbstractEntityPersister
-
isPhysicalDiscriminator
protected boolean isPhysicalDiscriminator()- Overrides:
isPhysicalDiscriminator
in classAbstractEntityPersister
-
generateDiscriminatorMapping
protected EntityDiscriminatorMapping generateDiscriminatorMapping(PersistentClass bootEntityDescriptor) - Overrides:
generateDiscriminatorMapping
in classAbstractEntityPersister
-
generateNonEncapsulatedCompositeIdentifierMapping
protected EntityIdentifierMapping generateNonEncapsulatedCompositeIdentifierMapping(MappingModelCreationProcess creationProcess, PersistentClass bootEntityDescriptor) - Overrides:
generateNonEncapsulatedCompositeIdentifierMapping
in classAbstractEntityPersister
-
getFilterAliasGenerator
-
getMappedTableDetails
Description copied from interface:EntityMappingType
Details 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
Description copied from interface:EntityMappingType
Details for the table that defines the identifier column(s) for an entity hierarchy. -
pruneForSubclasses
Description copied from interface:EntityMappingType
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.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
treatedEntityNames
only containsSub1
or any of its subtypes, this means thatSub2
and 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
-