Class JoinedSubclassEntityPersister
- java.lang.Object
-
- org.hibernate.persister.entity.AbstractEntityPersister
-
- org.hibernate.persister.entity.JoinedSubclassEntityPersister
-
- All Implemented Interfaces:
LazyPropertyInitializer,PostInsertIdentityPersister,Loadable,ClassMetadata,Bindable,Discriminatable,EntityMappingType,EntityValuedModelPart,FilterRestrictable,InFlightEntityMappingType,JdbcMappingContainer,ManagedMappingType,MappingModelExpressible,MappingType,ModelPart,ModelPartContainer,Restrictable,WhereRestrictable,EntityPersister,Joinable,Loadable,Lockable,EntityMutationTarget,OuterJoinLoadable,PropertyMapping,Queryable,SQLLoadable,UniqueKeyLoadable,AttributeSource,RootTableGroupProducer,TableGroupProducer,MutationTarget<EntityTableMapping>,FetchableContainer
public class JoinedSubclassEntityPersister extends AbstractEntityPersister
AnEntityPersisterimplementing the normalizedInheritanceType.JOINEDinheritance 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.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.IndexedJdbcValueConsumer, 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, insertCallable, insertExpectations, propertyMapping, rowIdName, staticFetchableList, updateCallable, updateExpectations, 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 JoinedSubclassEntityPersister(PersistentClass persistentClass, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy, RuntimeModelCreationContext creationContext)JoinedSubclassEntityPersister(PersistentClass persistentClass, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy, PersisterCreationContext creationContext)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDiscriminatorToInsertGroup(MutationGroupBuilder insertGroupBuilder)protected Map<Object,EntityDiscriminatorMapping.DiscriminatorValueDetails>buildDiscriminatorValueMappings(PersistentClass bootEntityDescriptor, MappingModelCreationProcess modelCreationProcess)<T> DomainResult<T>createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)Create a DomainResult for a specific reference to this ModelPart.intdetermineTableNumberForColumn(String columnName)StringfromTableFragment(String alias)Get the main from table fragment, given a query alias.protected EntityDiscriminatorMappinggenerateDiscriminatorMapping(PersistentClass bootEntityDescriptor, MappingModelCreationProcess modelCreationProcess)StringgenerateFilterConditionAlias(String rootAlias)The alias used for any filter conditions (mapped where-fragments or enabled-filters).protected EntityIdentifierMappinggenerateIdentifierMapping(Supplier<?> templateInstanceCreator, PersistentClass bootEntityDescriptor, MappingModelCreationProcess creationProcess)protected EntityIdentifierMappinggenerateNonEncapsulatedCompositeIdentifierMapping(MappingModelCreationProcess creationProcess, PersistentClass bootEntityDescriptor)protected EntityVersionMappinggenerateVersionMapping(Supplier<?> templateInstanceCreator, PersistentClass bootEntityDescriptor, MappingModelCreationProcess creationProcess)String[]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.StringgetDiscriminatorAlias()StringgetDiscriminatorColumnName()StringgetDiscriminatorColumnReaders()StringgetDiscriminatorColumnReaderTemplate()StringgetDiscriminatorSQLValue()Get the discriminator value for this particular concrete subclass, as a string that may be embedded in a select statementTypegetDiscriminatorType()Get the discriminator typeObjectgetDiscriminatorValue()Get the discriminator valueFilterAliasGeneratorgetFilterAliasGenerator(String rootAlias)String[]getIdentifierColumnNames()Get the names of columns used to persist the identifierString[]getIdentifierColumnReaders()String[]getIdentifierColumnReaderTemplates()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.Serializable[]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()StringgetRootTableAlias(String drivingAlias)Get the SQL alias this persister would use for the root table given the passed driving alias.StringgetRootTableName()Locks are always applied to the "root table".StringgetSubclassForDiscriminatorValue(Object value)Get the concrete subclass corresponding to the given discriminator valueQueryable.DeclarergetSubclassPropertyDeclarer(String propertyPath)Determine whether the given property is declared by our mapped class, our super class, or one of our subclasses...StringgetSubclassPropertyTableName(int i)Return the table name used to persist the numbered property of the class or a subclass.protected intgetSubclassPropertyTableNumber(int i)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()StringgetTableName()The table to join to.StringgetTableName(int j)intgetTableSpan()booleanhasDuplicateTables()protected booleanhasMultipleTables()booleanhasSkippableTables()Whether this target defines any potentially skippable tables.protected booleanisClassOrSuperclassTable(int j)protected booleanisIdentifierTable(String tableExpression)protected booleanisInverseSubclassTable(int j)booleanisInverseTable(int j)protected booleanisNullableSubclassTable(int j)booleanisNullableTable(int j)protected booleanisPhysicalDiscriminator()booleanisPropertyOfTable(int property, int j)protected booleanisSubclassTableIndicatedByTreatAsDeclarations(int subclassTableNumber, Set<String> treatAsDeclarations)booleanisTableCascadeDeleteEnabled(int j)voidpruneForSubclasses(TableGroup tableGroup, Set<String> treatedEntityNames)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()voidvisitConstraintOrderedTables(EntityMappingType.ConstraintOrderedTableConsumer consumer)protected voidvisitMutabilityOrderedTables(org.hibernate.persister.entity.AbstractEntityPersister.MutabilityOrderedTableConsumer consumer)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 amongst the entity's group of tables.-
Methods inherited from class org.hibernate.persister.entity.AbstractEntityPersister
afterInitialize, afterReassociate, applyBaseRestrictions, applyDiscriminator, applyFilterRestrictions, applySqlSelections, applySqlSelections, applyWhereRestrictions, buildCacheEntry, buildCacheEntryHelper, buildDeleteCoordinator, buildInsertCoordinator, buildTableMappings, buildUpdateCoordinator, canReadFromCache, canUseReferenceCacheEntries, canWriteToCache, check, checkVersion, consumesCollectionAlias, consumesEntityAlias, containsTableReference, countSubclassProperties, createPrimaryTableReference, createProxy, createRootTableGroup, createTableReferenceJoin, dehydrate, delete, determineTableName, disassemble, findAttributeMapping, findDeclaredAttributeMapping, findDirty, findModified, findSubPart, findSubTypesSubPart, forceVersionIncrement, forEachAttributeMapping, forEachAttributeMapping, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachMutableTable, forEachMutableTableReverse, forEachSelectable, generateDeleteString, generateJoinPredicate, generateLazySelectStringsByFetchGroup, generateLocker, generateSelectVersionString, generateSQLDeleteStrings, generateTableAlias, generateTableReferenceJoin, generateVersionMapping, getAttributeMapping, getAttributeMappings, getBytecodeEnhancementMetadata, getCacheAccessStrategy, getCacheEntryStructure, getCascadeStyle, getClassMetadata, getCollectionKey, getConcreteProxyClass, getCurrentVersion, getDatabaseSnapshot, getDeclaredAttributeMappings, getDeleteCoordinator, getDiscriminatorAlias, getDiscriminatorFormulaTemplate, getDiscriminatorMapping, getElementTypeDescriptor, getEntityEntryFactory, getEntityMetamodel, getEntityName, getEntityPersister, getEntityType, getFactory, getFetchable, getFetchMode, getGenerator, getIdByUniqueKey, getIdentifier, getIdentifierAliases, getIdentifierAliases, getIdentifierColumnSpan, getIdentifierDescriptor, getIdentifierGenerator, getIdentifierMapping, getIdentifierPropertyName, getIdentifierTableMapping, getIdentifierTableName, getIdentifierType, getIdentityInsertDelegate, getIdentitySelectString, getInsertCoordinator, getInstrumentationMetadata, getJdbcTypeCount, getKeyColumnNames, getKeyFetchable, getLazyPropertyColumnAliases, getMappedClass, getMappedJavaType, getMappedSuperclass, 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, getQuerySpaces, getRepresentationStrategy, getRootEntityName, getRootTableIdentifierColumnNames, getRootTableKeyColumnNames, getRowIdMapping, getSelectByUniqueKeyString, getSelectByUniqueKeyString, getSingleIdEntityLoader, getSqlAliasStem, getSQLDeleteStrings, getSQLUpdateStrings, 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, getVersion, getVersionColumnName, getVersionedTableName, getVersionGenerator, getVersionMapping, getVersionProperty, getVersionSelectString, getVersionType, hasAnySkippableTables, hasCache, hasCascadeDelete, hasCascades, hasCollections, hasFormulaProperties, hasIdentifierProperty, hasInsertGeneratedProperties, hasLazyDirtyFields, hasLazyProperties, hasMutableProperties, hasNaturalIdCache, hasNaturalIdentifier, hasOwnedCollections, hasPartitionedSelectionMapping, hasProxy, hasRowId, hasSubclasses, hasSubselectLoadableCollections, hasUninitializedLazyProperties, hasUpdateGeneratedProperties, implementsLifecycle, initializeEnhancedEntityUsedAsProxy, initializeLazyPropertiesFromCache, initializeLazyPropertiesFromDatastore, initializeLazyProperty, initializeLazyProperty, initPropertyPaths, initSubclassPropertyAliasesMap, insert, insert, instantiate, interpretSqmMultiTableInsertStrategy, interpretSqmMultiTableStrategy, isAbstract, isAffectedByEnabledFetchProfiles, isAffectedByEnabledFilters, isAffectedByEntityGraph, isAllNull, isAllOrDirtyOptLocking, isBatchable, isBatchLoadable, isCacheInvalidationRequired, isClassOrSuperclassJoin, isCollection, isDefinedOnSubclass, isDeleteCallable, isExplicitPolymorphism, isIdentifierAssignedByInsert, isInherited, isInsertCallable, isInstance, isInstrumented, isLazyPropertiesCacheable, isMultiTable, isMutable, isPolymorphic, isSelectBeforeUpdateRequired, 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, prepareMappingModel, processInsertGeneratedProperties, processUpdateGeneratedProperties, registerAffectingFetchProfile, resetIdentifier, resolveAttributeIndexes, resolveDirtyAttributeIndexes, resolvePrimaryTableReference, selectFragment, setIdentifier, setPropertyValue, setPropertyValue, setPropertyValues, shouldGetAllProperties, shouldInnerJoinSubclassTable, substituteBrackets, toColumns, toColumns, toString, toType, update, 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, forEachJdbcType, forEachJdbcValue, getJdbcMappings
-
Methods inherited from interface org.hibernate.metadata.ClassMetadata
getIdentifier, getIdentifier, getPropertyValuesToInsert, instantiate, setIdentifier
-
Methods inherited from interface org.hibernate.metamodel.mapping.EntityMappingType
createRootTableGroup, extractConcreteTypeStateValues, findContainingEntityMapping, findSubPart, getContributor, getJavaType, getPartMappingType, getRootEntityDescriptor, getRootPathName, getSubclassEntityNames, getSubclassId, isTypeOrSuperType
-
Methods inherited from interface org.hibernate.persister.entity.EntityPersister
breakDownJdbcValues, canExtractIdOutOfEntity, getEntityMappingType, getFilterAliasGenerator, getSynchronizationSpaces, getSynchronizedQuerySpaces, getValue, getValues, getVersionJavaType, load, setValue, setValues, 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.ManagedMappingType
anyRequiresAggregateColumnWriter
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, asAttributeMapping, decompose, forEachSelectable, isVirtual
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPartContainer
findByPath, forEachSubPart
-
Methods inherited from interface org.hibernate.sql.model.MutationTarget
getRolePath
-
Methods inherited from interface org.hibernate.persister.entity.OuterJoinLoadable
getAttributeMutationTableName
-
-
-
-
Constructor Detail
-
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 Detail
-
isNullableTable
public boolean isNullableTable(int j)
- Overrides:
isNullableTablein classAbstractEntityPersister
-
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 amongst 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>)
-
isIdentifierTable
protected boolean isIdentifierTable(String tableExpression)
- Specified by:
isIdentifierTablein classAbstractEntityPersister
-
hasSkippableTables
public boolean hasSkippableTables()
Description copied from interface:EntityMutationTargetWhether this target defines any potentially skippable tables.A table is considered potentially skippable if it is defined as inverse or as optional.
- Specified by:
hasSkippableTablesin interfaceEntityMutationTarget- Overrides:
hasSkippableTablesin classAbstractEntityPersister- See Also:
Table.inverse(),Table.optional()
-
isInverseTable
public boolean isInverseTable(int j)
- Overrides:
isInverseTablein classAbstractEntityPersister
-
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.
-
isInverseSubclassTable
protected boolean isInverseSubclassTable(int j)
- Overrides:
isInverseSubclassTablein classAbstractEntityPersister
-
isNullableSubclassTable
protected boolean isNullableSubclassTable(int j)
- Overrides:
isNullableSubclassTablein classAbstractEntityPersister
-
getDiscriminatorType
public Type getDiscriminatorType()
Description copied from interface:LoadableGet the discriminator type
-
getDiscriminatorValue
public Object getDiscriminatorValue()
Description copied from interface:LoadableGet the discriminator value
-
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
-
getDiscriminatorColumnName
public String getDiscriminatorColumnName()
- Specified by:
getDiscriminatorColumnNamein interfaceLoadable- Overrides:
getDiscriminatorColumnNamein classAbstractEntityPersister- Returns:
- the column name for the discriminator as specified in the mapping.
-
getDiscriminatorColumnReaders
public String getDiscriminatorColumnReaders()
- Overrides:
getDiscriminatorColumnReadersin classAbstractEntityPersister
-
getDiscriminatorColumnReaderTemplate
public String getDiscriminatorColumnReaderTemplate()
- Overrides:
getDiscriminatorColumnReaderTemplatein classAbstractEntityPersister
-
getDiscriminatorAlias
public String getDiscriminatorAlias()
- Overrides:
getDiscriminatorAliasin classAbstractEntityPersister
-
getSubclassForDiscriminatorValue
public String getSubclassForDiscriminatorValue(Object value)
Description copied from interface:LoadableGet the concrete subclass corresponding to the given discriminator value
-
buildDiscriminatorValueMappings
protected Map<Object,EntityDiscriminatorMapping.DiscriminatorValueDetails> buildDiscriminatorValueMappings(PersistentClass bootEntityDescriptor, MappingModelCreationProcess modelCreationProcess)
- Specified by:
buildDiscriminatorValueMappingsin classAbstractEntityPersister
-
addDiscriminatorToInsertGroup
public void addDiscriminatorToInsertGroup(MutationGroupBuilder insertGroupBuilder)
- Overrides:
addDiscriminatorToInsertGroupin classAbstractEntityPersister
-
getPropertySpaces
public Serializable[] 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.
-
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 alias)
Description copied from interface:OuterJoinLoadableGet the main from table fragment, given a query alias.
-
getTableName
public String getTableName()
Description copied from interface:JoinableThe table to join to.
-
generateFilterConditionAlias
public String generateFilterConditionAlias(String rootAlias)
Description copied from interface:QueryableThe 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:
generateFilterConditionAliasin interfaceQueryable- Overrides:
generateFilterConditionAliasin classAbstractEntityPersister- Parameters:
rootAlias- The root alias- Returns:
- The alias used for "filter conditions" within the where clause.
-
getIdentifierColumnNames
public String[] getIdentifierColumnNames()
Description copied from interface:LoadableGet the names of columns used to persist the identifier- Specified by:
getIdentifierColumnNamesin interfaceLoadable- Specified by:
getIdentifierColumnNamesin interfacePostInsertIdentityPersister- Specified by:
getIdentifierColumnNamesin interfaceQueryable- Overrides:
getIdentifierColumnNamesin classAbstractEntityPersister
-
getIdentifierColumnReaderTemplates
public String[] getIdentifierColumnReaderTemplates()
- Overrides:
getIdentifierColumnReaderTemplatesin classAbstractEntityPersister
-
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
-
getIdentifierColumnReaders
public String[] getIdentifierColumnReaders()
- Overrides:
getIdentifierColumnReadersin classAbstractEntityPersister
-
getSubclassPropertyTableNumber
protected int getSubclassPropertyTableNumber(int i)
- Specified by:
getSubclassPropertyTableNumberin classAbstractEntityPersister
-
getTableSpan
public int getTableSpan()
- Specified by:
getTableSpanin classAbstractEntityPersister
-
hasMultipleTables
protected boolean hasMultipleTables()
- Overrides:
hasMultipleTablesin classAbstractEntityPersister
-
getPropertyTableNumbers
protected int[] getPropertyTableNumbers()
- Specified by:
getPropertyTableNumbersin classAbstractEntityPersister
-
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
-
shouldProcessSuperMapping
protected boolean shouldProcessSuperMapping()
- Overrides:
shouldProcessSuperMappingin classAbstractEntityPersister
-
isClassOrSuperclassTable
protected boolean isClassOrSuperclassTable(int j)
- Specified by:
isClassOrSuperclassTablein classAbstractEntityPersister
-
isSubclassTableIndicatedByTreatAsDeclarations
protected boolean isSubclassTableIndicatedByTreatAsDeclarations(int subclassTableNumber, Set<String> treatAsDeclarations)- Overrides:
isSubclassTableIndicatedByTreatAsDeclarationsin 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 ;)
-
getRootTableAlias
public String getRootTableAlias(String drivingAlias)
Description copied from interface:LockableGet the SQL alias this persister would use for the root table given the passed driving alias.- Specified by:
getRootTableAliasin interfaceLockable- Overrides:
getRootTableAliasin 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
public Queryable.Declarer getSubclassPropertyDeclarer(String propertyPath)
Description copied from interface:QueryableDetermine 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:
getSubclassPropertyDeclarerin interfaceQueryable- Overrides:
getSubclassPropertyDeclarerin classAbstractEntityPersister- Parameters:
propertyPath- The property name.- Returns:
- The property declarer
-
determineTableNumberForColumn
public int determineTableNumberForColumn(String columnName)
- Overrides:
determineTableNumberForColumnin classAbstractEntityPersister
-
generateVersionMapping
protected EntityVersionMapping generateVersionMapping(Supplier<?> templateInstanceCreator, PersistentClass bootEntityDescriptor, MappingModelCreationProcess creationProcess)
- Overrides:
generateVersionMappingin classAbstractEntityPersister
-
generateIdentifierMapping
protected EntityIdentifierMapping generateIdentifierMapping(Supplier<?> templateInstanceCreator, PersistentClass bootEntityDescriptor, MappingModelCreationProcess creationProcess)
- Overrides:
generateIdentifierMappingin classAbstractEntityPersister
-
isPhysicalDiscriminator
protected boolean isPhysicalDiscriminator()
- Overrides:
isPhysicalDiscriminatorin classAbstractEntityPersister
-
generateDiscriminatorMapping
protected EntityDiscriminatorMapping generateDiscriminatorMapping(PersistentClass bootEntityDescriptor, MappingModelCreationProcess modelCreationProcess)
- Overrides:
generateDiscriminatorMappingin classAbstractEntityPersister
-
generateNonEncapsulatedCompositeIdentifierMapping
protected EntityIdentifierMapping generateNonEncapsulatedCompositeIdentifierMapping(MappingModelCreationProcess creationProcess, PersistentClass bootEntityDescriptor)
- Overrides:
generateNonEncapsulatedCompositeIdentifierMappingin classAbstractEntityPersister
-
getFilterAliasGenerator
public FilterAliasGenerator getFilterAliasGenerator(String rootAlias)
-
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.
-
createDomainResult
public <T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)
Description copied from interface:ModelPartCreate a DomainResult for a specific reference to this ModelPart.- Specified by:
createDomainResultin interfaceEntityValuedModelPart- Specified by:
createDomainResultin interfaceModelPart- Overrides:
createDomainResultin classAbstractEntityPersister
-
pruneForSubclasses
public void pruneForSubclasses(TableGroup tableGroup, Set<String> treatedEntityNames)
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 thetreatedEntityNamesonly 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 fortreatedEntityNames- The entity names for which path usages were registered
-
visitConstraintOrderedTables
public void visitConstraintOrderedTables(EntityMappingType.ConstraintOrderedTableConsumer consumer)
-
-