Class AbstractEntityPersister
- java.lang.Object
-
- org.hibernate.persister.entity.AbstractEntityPersister
-
- 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
- Direct Known Subclasses:
JoinedSubclassEntityPersister,SingleTableEntityPersister,UnionSubclassEntityPersister
public abstract class AbstractEntityPersister extends Object implements OuterJoinLoadable, ClassMetadata, UniqueKeyLoadable, SQLLoadable, LazyPropertyInitializer, PostInsertIdentityPersister, Lockable, Queryable, InFlightEntityMappingType, EntityMutationTarget
Basic functionality for persisting an entity via JDBC through either generated or custom SQL
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAbstractEntityPersister.CacheEntryHelperConsolidated these onto a single helper because the 2 pieces work in tandem.-
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 Modifier and Type Field Description protected ReflectionOptimizer.AccessOptimizeraccessOptimizerprotected intbatchSizeprotected String[]customSQLDeleteprotected String[]customSQLInsertprotected String[]customSQLUpdateprotected AttributeMappingsMapdeclaredAttributeMappingsprotected boolean[]deleteCallableprotected Expectation[]deleteExpectationsstatic StringENTITY_CLASSprotected boolean[]insertCallableprotected Expectation[]insertExpectationsprotected BasicEntityPropertyMappingpropertyMappingWarning: When there are duplicated property names in the subclasses then propertyMapping will only contain one of those properties.protected StringrowIdNameprotected AttributeMappingsListstaticFetchableListprotected boolean[]updateCallableprotected Expectation[]updateExpectationsstatic StringVERSION_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 AbstractEntityPersister(PersistentClass bootDescriptor, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy, RuntimeModelCreationContext creationContext)AbstractEntityPersister(PersistentClass bootDescriptor, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy, PersisterCreationContext creationContext)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddDiscriminatorToInsertGroup(MutationGroupBuilder insertGroupBuilder)voidafterInitialize(Object entity, SharedSessionContractImplementor session)Called just after the entities properties have been initializedvoidafterReassociate(Object entity, SharedSessionContractImplementor session)Called just after the entity has been reassociated with the sessionvoidapplyBaseRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String,Filter> enabledFilters, Set<String> treatAsDeclarations, SqlAstCreationState creationState)Applies the base set of restrictions.voidapplyDiscriminator(Consumer<Predicate> predicateConsumer, String alias, TableGroup tableGroup, SqlAstCreationState creationState)Apply the discriminator as a predicate via thepredicateConsumervoidapplyFilterRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String,Filter> enabledFilters, SqlAstCreationState creationState)Applies just theFiltervalues enabled for the associated entityvoidapplySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.voidapplySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection,JdbcMapping> selectionConsumer)Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.voidapplyWhereRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, SqlAstCreationState creationState)Apply theWhererestrictionsCacheEntrybuildCacheEntry(Object entity, Object[] state, Object version, SharedSessionContractImplementor session)protected AbstractEntityPersister.CacheEntryHelperbuildCacheEntryHelper()protected DeleteCoordinatorbuildDeleteCoordinator()protected abstract Map<Object,EntityDiscriminatorMapping.DiscriminatorValueDetails>buildDiscriminatorValueMappings(PersistentClass bootEntityDescriptor, MappingModelCreationProcess modelCreationProcess)protected InsertCoordinatorbuildInsertCoordinator()protected EntityTableMapping[]buildTableMappings()Builds the EntityTableMapping descriptors for the tables mapped by this entity.protected UpdateCoordinatorbuildUpdateCoordinator()booleancanReadFromCache()booleancanUseReferenceCacheEntries()booleancanWriteToCache()protected booleancheck(int rows, Object id, int tableNumber, Expectation expectation, PreparedStatement statement, String statementSQL)booleancheckVersion(boolean[] includeProperty)booleanconsumesCollectionAlias()Very, very, very ugly...booleanconsumesEntityAlias()Very, very, very ugly...booleancontainsTableReference(String tableExpression)intcountSubclassProperties()How many properties are there, for this class and all subclasses?<T> DomainResult<T>createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)Create a DomainResult for a specific reference to this ModelPart.TableReferencecreatePrimaryTableReference(SqlAliasBase sqlAliasBase, SqlExpressionResolver sqlExpressionResolver, SqlAstCreationContext creationContext)ObjectcreateProxy(Object id, SharedSessionContractImplementor session)Create a new proxy instanceTableGroupcreateRootTableGroup(boolean canUseInnerJoins, NavigablePath navigablePath, String explicitSourceAlias, Supplier<Consumer<Predicate>> additionalPredicateCollectorAccess, SqlAliasBase sqlAliasBase, SqlExpressionResolver sqlExpressionResolver, FromClauseAccess fromClauseAccess, SqlAstCreationContext creationContext)TableReferenceJoincreateTableReferenceJoin(String joinTableExpression, SqlAliasBase sqlAliasBase, TableReference lhs, SqlExpressionResolver sqlExpressionResolver, SqlAstCreationContext creationContext)@org.hibernate.Remove intdehydrate(Object id, Object[] fields, Object rowId, boolean[] includeProperty, boolean[][] includeColumns, int j, PreparedStatement ps, SharedSessionContractImplementor session, int index, boolean isUpdate)Deprecated, for removal: This API element is subject to removal in a future version.No longer used.voiddelete(Object id, Object version, Object object, SharedSessionContractImplementor session)Delete an objectprotected StringdetermineTableName(Table table)intdetermineTableNumberForColumn(String columnName)Objectdisassemble(Object value, SharedSessionContractImplementor session)AttributeMappingfindAttributeMapping(String name)Find an attribute by name.AttributeMappingfindDeclaredAttributeMapping(String name)Find an attribute-mapping, declared on this entity mapping (not super or subs), by nameint[]findDirty(Object[] currentState, Object[] previousState, Object entity, SharedSessionContractImplementor session)Locate the property-indices of all properties considered to be dirty.int[]findModified(Object[] old, Object[] current, Object entity, SharedSessionContractImplementor session)Locate the property-indices of all properties considered to be dirty.ModelPartfindSubPart(String name, EntityMappingType treatTargetType)ModelPartfindSubTypesSubPart(String name, EntityMappingType treatTargetType)ObjectforceVersionIncrement(Object id, Object currentVersion, SharedSessionContractImplementor session)voidforEachAttributeMapping(Consumer<? super AttributeMapping> action)Visit each attribute mappingvoidforEachAttributeMapping(IndexedConsumer<? super AttributeMapping> consumer)Visit attributes defined on this class and any supersintforEachDisassembledJdbcValue(Object value, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)intforEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)Visit each JdbcMapping starting from the given offsetintforEachJdbcValue(Object value, int offset, Bindable.JdbcValuesConsumer consumer, SharedSessionContractImplementor session)voidforEachMutableTable(Consumer<EntityTableMapping> consumer)Visit each table.voidforEachMutableTableReverse(Consumer<EntityTableMapping> consumer)Same asMutationTarget.forEachMutableTable(java.util.function.Consumer<T>)except that here the tables are visited in reverse orderintforEachSelectable(int offset, SelectableConsumer selectableConsumer)StringgenerateDeleteString(int j)Deprecated, for removal: This API element is subject to removal in a future version.No longer used.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 PredicategenerateJoinPredicate(TableReference rootTableReference, TableReference joinedTableReference, String[] fkColumnNames, SqlExpressionResolver sqlExpressionResolver)protected Map<String,SingleIdArrayLoadPlan>generateLazySelectStringsByFetchGroup()protected LockingStrategygenerateLocker(LockMode lockMode)protected EntityIdentifierMappinggenerateNonEncapsulatedCompositeIdentifierMapping(MappingModelCreationProcess creationProcess, PersistentClass bootEntityDescriptor)StringgenerateSelectVersionString()Generate the SQL that selects the version number by idprotected String[]generateSQLDeleteStrings(Object[] loadedState)Deprecated, for removal: This API element is subject to removal in a future version.static StringgenerateTableAlias(String rootAlias, int tableNumber)protected TableReferenceJoingenerateTableReferenceJoin(TableReference lhs, String joinTableExpression, SqlAliasBase sqlAliasBase, boolean innerJoin, String[] targetColumns, SqlExpressionResolver sqlExpressionResolver)protected EntityVersionMappinggenerateVersionMapping(Supplier<?> templateInstanceCreator, PersistentClass bootEntityDescriptor, MappingModelCreationProcess creationProcess)protected static EntityVersionMappinggenerateVersionMapping(AbstractEntityPersister entityPersister, Supplier<?> templateInstanceCreator, PersistentClass bootModelRootEntityDescriptor, MappingModelCreationProcess creationProcess)AttributeMappinggetAttributeMapping(int position)Retrieve an attribute mapping by position, relative to all attributesAttributeMappingsListgetAttributeMappings()The attributes mapping for this entity, including those declared on supertype mappingsBytecodeEnhancementMetadatagetBytecodeEnhancementMetadata()EntityDataAccessgetCacheAccessStrategy()Get the cache (optional operation)CacheEntryStructuregetCacheEntryStructure()Get the cache structureCascadeStylegetCascadeStyle(int i)Get the cascade style of this (subclass closure) propertyClassMetadatagetClassMetadata()Deprecated.ObjectgetCollectionKey(CollectionPersister persister, Object owner, EntityEntry ownerEntry, SharedSessionContractImplementor session)Class<?>getConcreteProxyClass()Get the proxy interface that instances of this concrete class will be cast to (optional operation).ObjectgetCurrentVersion(Object id, SharedSessionContractImplementor session)Retrieve the version numberObject[]getDatabaseSnapshot(Object id, SharedSessionContractImplementor session)Get the current database state of the object, in a "hydrated" form, without resolving identifiers.AttributeMappingsMapgetDeclaredAttributeMappings()Get access to the attributes defined on this class - do not access attributes defined on the superDeleteCoordinatorgetDeleteCoordinator()StringgetDiscriminatorAlias()StringgetDiscriminatorAlias(String suffix)Get the result set aliases used for the identifier columns, given a suffixStringgetDiscriminatorColumnName()StringgetDiscriminatorColumnReaders()StringgetDiscriminatorColumnReaderTemplate()StringgetDiscriminatorFormulaTemplate()EntityDiscriminatorMappinggetDiscriminatorMapping()Mapping details for the entity's discriminator.EntityMappingTypegetElementTypeDescriptor()Deprecated, for removal: This API element is subject to removal in a future version.With no replacement.EntityEntryFactorygetEntityEntryFactory()Get the EntityEntryFactory indicated for the entity mapped by this persister.EntityMetamodelgetEntityMetamodel()Retrieve the underlying entity metamodel instance.StringgetEntityName()The entity name which this persister maps.EntityPersistergetEntityPersister()Safety-net.EntityTypegetEntityType()SessionFactoryImplementorgetFactory()Return theSessionFactoryto which this persister belongs.FetchablegetFetchable(int position)FetchModegetFetchMode(int i)May this (subclass closure) property be fetched using an SQL outerjoin?GeneratorgetGenerator()ObjectgetIdByUniqueKey(Object key, String uniquePropertyName, SharedSessionContractImplementor session)ObjectgetIdentifier(Object entity, SharedSessionContractImplementor session)Get the identifier of an instance from the object's identifier property.String[]getIdentifierAliases()String[]getIdentifierAliases(String suffix)Get the result set aliases used for the identifier columns, given a suffixString[]getIdentifierColumnNames()Get the names of columns used to persist the identifierString[]getIdentifierColumnReaders()String[]getIdentifierColumnReaderTemplates()intgetIdentifierColumnSpan()ModelPartgetIdentifierDescriptor()The ModelPart describing the identifier/key for this targetIdentifierGeneratorgetIdentifierGenerator()Deprecated.EntityIdentifierMappinggetIdentifierMapping()Mapping details for the entity's identifier.StringgetIdentifierPropertyName()Get the name of the identifier property (or return null) - need not return the name of an actual Java propertyEntityTableMappinggetIdentifierTableMapping()The descriptor for the table containing the identifier for the targetStringgetIdentifierTableName()The name of the table defining the identifier for this targetTypegetIdentifierType()Get the identifier typeInsertGeneratedIdentifierDelegategetIdentityInsertDelegate()The delegate for executing inserts against the root table for targets defined using post-insert id generationStringgetIdentitySelectString()Get the database-specific SQL command to retrieve the last generated IDENTITY value.InsertCoordinatorgetInsertCoordinator()BytecodeEnhancementMetadatagetInstrumentationMetadata()intgetJdbcTypeCount()The number of JDBC mappingsString[]getKeyColumnNames()The columns to join onabstract String[]getKeyColumns(int j)FetchablegetKeyFetchable(int position)protected String[][]getLazyPropertyColumnAliases()Class<?>getMappedClass()The persistent class, or nullJavaType<?>getMappedJavaType()The descriptor descriptor for the mapped Java typeStringgetMappedSuperclass()Get the name of the entity that is the "super class" for this entityMultiNaturalIdLoader<?>getMultiNaturalIdLoader()Access to performing multi-value natural-id database selection.StringgetName()An identifying name; a class name or collection role name.NaturalIdDataAccessgetNaturalIdCacheAccessStrategy()Get the NaturalId cache (optional operation)int[]getNaturalIdentifierProperties()If the entity defines a natural id, that is, ifEntityPersister.hasNaturalIdentifier()returnstrue, the indices of the properties which make up the natural id.ObjectgetNaturalIdentifierSnapshot(Object id, SharedSessionContractImplementor session)Retrieve the current state of the natural-id properties from the database.NaturalIdLoader<?>getNaturalIdLoader()Access to performing natural-id database selection.NaturalIdMappinggetNaturalIdMapping()The mapping for the natural-id of the entity, if one is definedNavigableRolegetNavigableRole()The model role of this targetboolean[]getNonLazyPropertyUpdateability()intgetNumberOfAttributeMappings()The total number of attributes for this entity, including those declared on supertype mappingsintgetNumberOfDeclaredAttributeMappings()Get the number of attributes defined on this entity mapping - do not access attributes defined on the superintgetNumberOfFetchableKeys()The number of fetchables in the containerintgetNumberOfFetchables()The number of fetchables in the containerintgetNumberOfKeyFetchables()The number of key fetchables in the containerStringgetPartName()The local part name, which is generally the unqualified role nameEntityTableMappinggetPhysicalTableMappingForMutation(SelectableMapping selectableMapping)String[]getPropertyAliases(String suffix, int i)Get the result set aliases used for the property columns, given a suffix (properties of this class, only).CascadeStyle[]getPropertyCascadeStyles()Get the cascade styles of the properties (optional operation)boolean[]getPropertyCheckability()Get the "checkability" of the properties of this class (is the property dirty checked, does the cache need to be updated)boolean[][]getPropertyColumnInsertable()String[]getPropertyColumnNames(int i)Get the result set column names mapped for this property (properties of this class, only).String[]getPropertyColumnNames(String propertyName)Get the column names for the given property pathintgetPropertyColumnSpan(int i)boolean[][]getPropertyColumnUpdateable()String[]getPropertyColumnWriters(int i)intgetPropertyIndex(String propertyName)Get the property number of the unique key propertyboolean[]getPropertyInsertability()Get the "insertability" of the properties of this class (does the property appear in an SQL INSERT)boolean[]getPropertyLaziness()Get the "laziness" of the properties of this classString[]getPropertyNames()Get the names of the class properties - doesn't have to be the names of the actual Java properties (used for XML generation only)boolean[]getPropertyNullability()Get the nullability of the properties of this classintgetPropertySpan()StringgetPropertyTableName(String propertyName)Get the table name for the given property pathprotected abstract int[]getPropertyTableNumbers()TypegetPropertyType(String propertyName)Get the type of a particular property by name.Type[]getPropertyTypes()Get the Hibernate types of the class propertiesboolean[]getPropertyUpdateability()Get the "updateability" of the properties of this class (does the property appear in an SQL UPDATE)boolean[]getPropertyUpdateability(Object entity)Which properties appear in the SQL update? (Initialized, updateable ones!)ObjectgetPropertyValue(Object object, int i)ObjectgetPropertyValue(Object object, String propertyName)Get the value of a particular propertyObject[]getPropertyValues(Object object)Extract the property values from the given entity.Object[]getPropertyValuesToInsert(Object entity, Map<Object,Object> mergeMap, SharedSessionContractImplementor session)Return the values of the insertable properties of the object (including backrefs)boolean[]getPropertyVersionability()Get the "versionability" of the properties of this class (is the property optimistic-locked)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.EntityRepresentationStrategygetRepresentationStrategy()Describes how the entity is represented in the application's domain model.StringgetRootEntityName()Returns an object that identifies the space in which identifiers of this entity hierarchy are unique.StringgetRootTableAlias(String drivingAlias)Get the SQL alias this persister would use for the root table given the passed driving alias.String[]getRootTableIdentifierColumnNames()Get the names of columns on the root table used to persist the identifier.String[]getRootTableKeyColumnNames()The names of the primary key columns in the root table.StringgetRootTableName()Locks are always applied to the "root table".EntityRowIdMappinggetRowIdMapping()The mapping for the row-id of the entity, if one is defined.StringgetSelectByUniqueKeyString(String propertyName)Get a SQL select string that performs a select based on a unique key determined by the given property name.StringgetSelectByUniqueKeyString(String[] propertyNames)Get a SQL select string that performs a select based on a unique key determined by the given property names.SingleIdEntityLoader<?>getSingleIdEntityLoader()StringgetSqlAliasStem()Get the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generatedString[]getSQLDeleteStrings()Deprecated, for removal: This API element is subject to removal in a future version.No longer used.String[]getSQLUpdateStrings()Deprecated, for removal: This API element is subject to removal in a future version.No longer used.SqmMultiTableInsertStrategygetSqmMultiTableInsertStrategy()SqmMultiTableMutationStrategygetSqmMultiTableMutationStrategy()The strategy to use for SQM mutation statements where the target entity has multiple tables.protected intgetStateArrayInitialPosition(MappingModelCreationProcess creationProcess)protected AttributeMappingsListgetStaticFetchableList()protected String[]getSubclassColumnAliasClosure()EntityPersistergetSubclassEntityPersister(Object instance, SessionFactoryImplementor factory)Obtain theEntityPersisterfor the concrete class of the given entity instance which participates in a mapped inheritance hierarchy with this persister.protected String[]getSubclassFormulaAliasClosure()String[]getSubclassPropertyColumnAliases(String propertyName, String suffix)Return the column alias names used to persist/query the named property of the class or a subclass (optional operation).protected String[][]getSubclassPropertyColumnNameClosure()String[]getSubclassPropertyColumnNames(int i)Return the column names used to persist the numbered property of the class or a subclass.String[]getSubclassPropertyColumnNames(String propertyName)Return the column names used to persist/query the named property of the class or a subclass (optional operation).String[][]getSubclassPropertyColumnReaderClosure()String[][]getSubclassPropertyColumnReaderTemplateClosure()Queryable.DeclarergetSubclassPropertyDeclarer(String propertyPath)Determine whether the given property is declared by our mapped class, our super class, or one of our subclasses...String[][]getSubclassPropertyFormulaTemplateClosure()StringgetSubclassPropertyName(int i)Get the name of the numbered property of the class or a subclass.protected String[]getSubclassPropertyNameClosure()protected abstract intgetSubclassPropertyTableNumber(int i)intgetSubclassPropertyTableNumber(String propertyPath)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.TypegetSubclassPropertyType(int i)Get the type of the numbered property of the class or a subclass.protected Type[]getSubclassPropertyTypeClosure()protected abstract String[]getSubclassTableKeyColumns(int j)abstract StringgetSubclassTableName(int j)Get the name of the table with the given index from the internal array.protected abstract String[]getSubclassTableNames()abstract intgetSubclassTableSpan()Collection<EntityMappingType>getSubMappingTypes()Retrieve mappings for all subtypesEntityMappingTypegetSuperMappingType()The mapping for the entity which is the supertype for this entity mapping.StringgetTableAliasForColumn(String columnName, String rootAlias)Given a column name and the root table alias in use for the entity hierarchy, determine the proper table alias for the table in that hierarchy that contains said column.protected boolean[]getTableHasColumns()static intgetTableId(String tableName, String[] tables)EntityTableMappinggetTableMapping(int i)protected EntityTableMapping[]getTableMappings()intgetTableMappingsCount()abstract StringgetTableName(int j)Deprecated.Only ever used from places where we really want to useSelectStatement(select generator)InsertSelectStatementUpdateStatementDeleteStatementString[]getTableNames()abstract intgetTableSpan()@org.hibernate.Remove boolean[]getTableUpdateNeeded(int[] dirtyProperties, boolean hasDirtyCollection)Deprecated, for removal: This API element is subject to removal in a future version.No longer used.EntityMappingTypegetTargetPart()The ModelPart describing the mutation targetTypegetType()Get the typeDiscriminatorMetadatagetTypeDiscriminatorMetadata()Retrieve the information needed to properly deal with this entity's discriminator in a query.protected SingleUniqueKeyEntityLoader<?>getUniqueKeyLoader(String attributeName)UpdateCoordinatorgetUpdateCoordinator()ObjectgetVersion(Object object)Get the version number (or timestamp) from the object's version property.StringgetVersionColumnName()For versioned entities, get the name of the column (again, expected on the root table) used to store the version values.StringgetVersionedTableName()BeforeExecutionGeneratorgetVersionGenerator()EntityVersionMappinggetVersionMapping()Mapping details for the entity's version when using the version strategy.intgetVersionProperty()IfEntityPersister.isVersioned(), then what is the index of the property holding the locking value.StringgetVersionSelectString()BasicType<?>getVersionType()IfEntityPersister.isVersioned(), then what is the type of the property holding the locking value.protected booleanhasAnySkippableTables(boolean[] optionalTables, boolean[] inverseTables)booleanhasCache()Does this class have a cache.booleanhasCascadeDelete()Determine whether this entity has any delete cascading.booleanhasCascades()Determine whether this entity has any (non-none) cascading.booleanhasCollections()Determine whether this entity contains references to persistent collections.abstract booleanhasDuplicateTables()booleanhasFormulaProperties()booleanhasIdentifierProperty()Determine whether the entity has a particular property holding the identifier value.booleanhasInsertGeneratedProperties()Does this entity define any properties as being database generated on insert?booleanhasLazyDirtyFields(int[] dirtyFields)booleanhasLazyProperties()Determine whether this entity defines any lazy properties (when bytecode instrumentation is enabled).protected booleanhasMultipleTables()booleanhasMutableProperties()Determine whether any properties of this entity are considered mutable.booleanhasNaturalIdCache()Does this class have a natural id cachebooleanhasNaturalIdentifier()Determine whether this entity defines a natural identifier.booleanhasOwnedCollections()Determine whether this entity has any owned collections.booleanhasPartitionedSelectionMapping()booleanhasProxy()Determine whether this entity supports dynamic proxies.booleanhasRowId()Does the result set contain rowids?booleanhasSkippableTables()Whether this target defines any potentially skippable tables.booleanhasSubclasses()Does this persistent class have subclasses?booleanhasSubselectLoadableCollections()Determine whether this entity contains references to persistent collections which are fetchable by subselect?booleanhasUninitializedLazyProperties(Object object)Does the given instance have any uninitialized lazy properties?booleanhasUpdateGeneratedProperties()Does this entity define any properties as being database generated on update?booleanimplementsLifecycle()Does the class implement theLifecycleinterface?ObjectinitializeEnhancedEntityUsedAsProxy(Object entity, String nameOfAttributeBeingAccessed, SharedSessionContractImplementor session)Called fromEnhancementAsProxyLazinessInterceptorto trigger load of the entity's non-lazy state as well as the named attribute we are accessing if it is still uninitialized after fetching non-lazy state.protected ObjectinitializeLazyPropertiesFromCache(String fieldName, Object entity, SharedSessionContractImplementor session, EntityEntry entry, CacheEntry cacheEntry)protected ObjectinitializeLazyPropertiesFromDatastore(Object entity, Object id, EntityEntry entry, String fieldName, SharedSessionContractImplementor session)protected booleaninitializeLazyProperty(String fieldName, Object entity, EntityEntry entry, int index, Object propValue)ObjectinitializeLazyProperty(String fieldName, Object entity, SharedSessionContractImplementor session)Initialize the property, and return its new value.protected voidinitPropertyPaths(Metadata mapping)protected voidinitSubclassPropertyAliasesMap(PersistentClass model)Must be called by subclasses, at the end of their constructorsObjectinsert(Object[] fields, Object object, SharedSessionContractImplementor session)Persist an instance, using a natively generated identifier (optional operation)voidinsert(Object id, Object[] fields, Object object, SharedSessionContractImplementor session)Persist an instanceObjectinstantiate(Object id, SharedSessionContractImplementor session)Create a class instance initialized with the given identifierprotected static SqmMultiTableInsertStrategyinterpretSqmMultiTableInsertStrategy(AbstractEntityPersister entityMappingDescriptor, MappingModelCreationProcess creationProcess)protected static SqmMultiTableMutationStrategyinterpretSqmMultiTableStrategy(AbstractEntityPersister entityMappingDescriptor, MappingModelCreationProcess creationProcess)booleanisAbstract()Whether this entity is defined as abstract using the JavaabstractkeywordbooleanisAffectedByEnabledFetchProfiles(LoadQueryInfluencers loadQueryInfluencers)Whether any of the LoadQueryInfluencers.getEnabledFetchProfileNames() apply to this loadablebooleanisAffectedByEnabledFilters(LoadQueryInfluencers loadQueryInfluencers)Whether any of the "influencers" affect this loadable.booleanisAffectedByEntityGraph(LoadQueryInfluencers loadQueryInfluencers)Whether the effective entity-graph applies to this loadable@org.hibernate.Remove booleanisAllNull(Object[] array, int tableNumber)Deprecated, for removal: This API element is subject to removal in a future version.protected booleanisAllOrDirtyOptLocking()@org.hibernate.Remove booleanisBatchable()Deprecated, for removal: This API element is subject to removal in a future version.No longer used.booleanisBatchLoadable()Is batch loading enabled?booleanisCacheInvalidationRequired()We can't immediately add to the cache if we have formulas which must be evaluated, or if we have the possibility of two concurrent updates to the same item being merged on the database.protected booleanisClassOrSuperclassJoin(int j)protected abstract booleanisClassOrSuperclassTable(int j)booleanisCollection()Is this instance actually a CollectionPersister?booleanisDefinedOnSubclass(int i)Is this property defined on a subclass of the mapped class.booleanisDeleteCallable(int j)Deprecated, for removal: This API element is subject to removal in a future version.With no replacementbooleanisExplicitPolymorphism()Is this class explicit polymorphism only?booleanisIdentifierAssignedByInsert()Are identifiers of this entity assigned known before the insert execution? Or, are they generated (in the database) by the insert execution.protected abstract booleanisIdentifierTable(String tableExpression)booleanisInherited()Determine whether the entity is inherited one or more other entities.booleanisInsertCallable(int j)Deprecated, for removal: This API element is subject to removal in a future version.With no replacementbooleanisInstance(Object object)Is the given object an instance of this entity?booleanisInstrumented()Has the class actually been bytecode instrumented?protected @org.hibernate.Remove booleanisInverseSubclassTable(int j)Deprecated, for removal: This API element is subject to removal in a future version.No longer usedbooleanisInverseTable(int j)booleanisLazyPropertiesCacheable()Should lazy properties of this entity be cached?booleanisMultiTable()Deprecated.booleanisMutable()Determine whether instances of this entity are considered mutable.protected booleanisNullableSubclassTable(int j)booleanisNullableTable(int j)protected booleanisPhysicalDiscriminator()booleanisPolymorphic()abstract booleanisPropertyOfTable(int property, int j)booleanisSelectBeforeUpdateRequired()Is select snapshot before update enabled?booleanisSubclassEntityName(String entityName)Determine whether the given name represents a subclass entity (or this entity itself) of the entity mapped by this persister.booleanisSubclassPropertyNullable(int i)Is the numbered property of the class of subclass nullable?protected booleanisSubclassTableIndicatedByTreatAsDeclarations(int subclassTableNumber, Set<String> treatAsDeclarations)protected booleanisSubclassTableSequentialSelect(int j)Deprecated, for removal: This API element is subject to removal in a future version.With no replacementabstract @org.hibernate.Remove booleanisTableCascadeDeleteEnabled(int j)Deprecated, for removal: This API element is subject to removal in a future version.No longer usedBooleanisTransient(Object entity, SharedSessionContractImplementor session)Is this a new transient instance?booleanisTypeOrSuperType(EntityMappingType targetType)Whether the passed entity mapping is the same as or is a supertype of this entity mappingbooleanisUpdateCallable(int j)Deprecated, for removal: This API element is subject to removal in a future version.With no replacementbooleanisVersioned()Determine whether optimistic locking by column is enabled for this entity.booleanisVersionGeneratedBeforeExecution()booleanisVersionGeneratedOnExecution()booleanisVersionPropertyGenerated()Does this entity contain a version property that is defined to be database generated?booleanisVersionPropertyInsertable()Is the version property included in insert statements?protected voidlinkToSession(Object entity, SharedSessionContractImplementor session)voidlinkWithSubType(EntityMappingType sub, MappingModelCreationProcess creationProcess)voidlinkWithSuperType(MappingModelCreationProcess creationProcess)Link an entity type with its super-type, if one.Objectload(Object id, Object optionalObject, LockMode lockMode, SharedSessionContractImplementor session)Load an instance using either theforUpdateLoaderor the outer joiningloader, depending upon the value of thelockparameterObjectload(Object id, Object optionalObject, LockOptions lockOptions, SharedSessionContractImplementor session)Load an instance using either theforUpdateLoaderor the outer joiningloader, depending upon the value of thelockparameterObjectload(Object id, Object optionalObject, LockOptions lockOptions, SharedSessionContractImplementor session, Boolean readOnly)ObjectloadByUniqueKey(String propertyName, Object uniqueKey, Boolean readOnly, SharedSessionContractImplementor session)ObjectloadByUniqueKey(String propertyName, Object uniqueKey, SharedSessionContractImplementor session)Load an instance of the persistent class, by a unique key other than the primary key.ObjectloadEntityIdByNaturalId(Object[] naturalIdValues, LockOptions lockOptions, SharedSessionContractImplementor session)Load the id for the entity based on the natural id.voidlock(Object id, Object version, Object object, LockMode lockMode, EventSource session)Do a version check (optional operation)voidlock(Object id, Object version, Object object, LockOptions lockOptions, EventSource session)Do a version check (optional operation)protected voidlogStaticSQL()List<?>multiLoad(Object[] ids, EventSource session, MultiIdLoadOptions loadOptions)Performs a load of multiple entities (of this type) by identifier simultaneously.OptimisticLockStyleoptimisticLockStyle()The type of optimistic locking, if any, defined for this entity mappingStringphysicalTableNameForMutation(SelectableMapping selectableMapping)Unfortunately we cannot directly use `SelectableMapping#getContainingTableExpression()` as that blows up for attributes declared on super-type for union-subclass mappingsprotected voidpostConstruct(Metadata mapping)Post-construct is a callback for AbstractEntityPersister subclasses to call after they are all done with their constructor processing.voidpostInstantiate()Finish the initialization of this object.voidprepareMappingModel(MappingModelCreationProcess creationProcess)After all hierarchy types have been linked, this method is called to allow the mapping model to be prepared which generally includes creating attribute mapping descriptors, identifier mapping descriptor, etc.voidprocessInsertGeneratedProperties(Object id, Object entity, Object[] state, SharedSessionContractImplementor session)Perform a select to retrieve the values of any generated properties back from the database, injecting these generated values into the given entity as well as writing this state to thePersistenceContext.voidprocessUpdateGeneratedProperties(Object id, Object entity, Object[] state, SharedSessionContractImplementor session)Perform a select to retrieve the values of any generated properties back from the database, injecting these generated values into the given entity as well as writing this state to thePersistenceContext.voidregisterAffectingFetchProfile(String fetchProfileName)Register the name of a fetch profile determined to have an affect on the underlying loadable in regards to the fact that the underlying load SQL needs to be adjust when the given fetch profile is enabled.voidresetIdentifier(Object entity, Object currentId, Object currentVersion, SharedSessionContractImplementor session)Set the identifier and version of the given instance back to its "unsaved" value, that is, the value it had before it was made persistent.int[]resolveAttributeIndexes(String[] attributeNames)Converts an array of attribute names to a set of indexes, according to the entity metamodelint[]resolveDirtyAttributeIndexes(Object[] currentState, Object[] previousState, String[] attributeNames, SessionImplementor session)LikeEntityPersister.resolveAttributeIndexes(String[])but also always returns mutable attributesprotected TableReferenceresolvePrimaryTableReference(SqlAliasBase sqlAliasBase)StringselectFragment(String alias, String suffix)Generate a list of collection index, key and element columnsvoidsetIdentifier(Object entity, Object id, SharedSessionContractImplementor session)Inject the identifier value into the given entity.voidsetPropertyValue(Object object, int i, Object value)Set the value of a particular property of the given instance.voidsetPropertyValue(Object object, String propertyName, Object value)Set the value of a particular (named) propertyvoidsetPropertyValues(Object object, Object[] values)Set the given values to the mapped properties of the given object.protected booleanshouldGetAllProperties(Object entity)protected booleanshouldInnerJoinSubclassTable(int subclassTableNumber, Set<String> treatAsDeclarations)protected booleanshouldProcessSuperMapping()protected StringsubstituteBrackets(String sql)String[]toColumns(String propertyName)Given a property path, return the corresponding column name(s).String[]toColumns(String name, int i)Given the number of a property of a subclass, and a table alias, return the aliased column names.StringtoString()TypetoType(String propertyName)Given a component path expression, get the type of the propertyvoidupdate(Object id, Object[] values, int[] dirtyAttributeIndexes, boolean hasDirtyCollection, Object[] oldValues, Object oldVersion, Object object, Object rowId, SharedSessionContractImplementor session)Update an objectvoidvisitAttributeMappings(Consumer<? super AttributeMapping> action, EntityMappingType targetType)Visit the mappings, but limited to just attributes defined in the targetType or its super-type(s) if any.voidvisitDeclaredAttributeMappings(Consumer<? super AttributeMapping> action)Visit attributes defined on this class - do not visit attributes defined on the supervoidvisitFetchables(Consumer<? super Fetchable> fetchableConsumer, EntityMappingType treatTargetType)voidvisitFetchables(IndexedConsumer<? super Fetchable> fetchableConsumer, EntityMappingType treatTargetType)voidvisitKeyFetchables(Consumer<? super Fetchable> fetchableConsumer, EntityMappingType treatTargetType)voidvisitKeyFetchables(IndexedConsumer<? super Fetchable> fetchableConsumer, EntityMappingType treatTargetType)protected abstract 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.voidvisitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType)voidvisitSubTypeAttributeMappings(Consumer<? super AttributeMapping> action)Walk this type's attributes as well as its sub-type'svoidvisitSuperTypeAttributeMappings(Consumer<? super AttributeMapping> action)Walk this type's attributes as well as its super-type's-
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, getIdentifierTableDetails, getJavaType, getMappedTableDetails, getPartMappingType, getRootEntityDescriptor, getRootPathName, getSubclassEntityNames, getSubclassId, isTypeOrSuperType, pruneForSubclasses, visitConstraintOrderedTables
-
Methods inherited from interface org.hibernate.persister.entity.EntityPersister
breakDownJdbcValues, canExtractIdOutOfEntity, getEntityMappingType, getFilterAliasGenerator, getFilterAliasGenerator, getPropertySpaces, 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.persister.entity.Joinable
getTableName
-
Methods inherited from interface org.hibernate.persister.entity.Loadable
getDiscriminatorType, getDiscriminatorValue, getSubclassForDiscriminatorValue
-
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
fromTableFragment, getAttributeMutationTableName, getSubclassPropertyTableName
-
Methods inherited from interface org.hibernate.persister.entity.Queryable
getConstraintOrderedTableNameClosure, getContraintOrderedTableKeyColumnClosure, getDiscriminatorSQLValue
-
-
-
-
Field Detail
-
ENTITY_CLASS
public static final String ENTITY_CLASS
- See Also:
- Constant Field Values
-
VERSION_COLUMN_ALIAS
public static final String VERSION_COLUMN_ALIAS
- See Also:
- Constant Field Values
-
batchSize
protected final int batchSize
-
rowIdName
protected final String rowIdName
-
insertExpectations
protected Expectation[] insertExpectations
-
updateExpectations
protected Expectation[] updateExpectations
-
deleteExpectations
protected Expectation[] deleteExpectations
-
insertCallable
protected boolean[] insertCallable
-
updateCallable
protected boolean[] updateCallable
-
deleteCallable
protected boolean[] deleteCallable
-
customSQLInsert
protected String[] customSQLInsert
-
customSQLUpdate
protected String[] customSQLUpdate
-
customSQLDelete
protected String[] customSQLDelete
-
declaredAttributeMappings
protected AttributeMappingsMap declaredAttributeMappings
-
staticFetchableList
protected AttributeMappingsList staticFetchableList
-
accessOptimizer
protected ReflectionOptimizer.AccessOptimizer accessOptimizer
-
propertyMapping
protected final BasicEntityPropertyMapping propertyMapping
Warning: When there are duplicated property names in the subclasses then propertyMapping will only contain one of those properties. To ensure correct results, propertyMapping should only be used for the concrete EntityPersister (since the concrete EntityPersister cannot have duplicated property names).
-
-
Constructor Detail
-
AbstractEntityPersister
@Deprecated(since="6.0") public AbstractEntityPersister(PersistentClass bootDescriptor, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy, PersisterCreationContext creationContext) throws HibernateException
Deprecated.- Throws:
HibernateException
-
AbstractEntityPersister
public AbstractEntityPersister(PersistentClass bootDescriptor, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy, RuntimeModelCreationContext creationContext) throws HibernateException
- Throws:
HibernateException
-
-
Method Detail
-
getSubclassTableName
public abstract 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- Parameters:
j- The index into the internal array.
-
getSubclassTableNames
protected abstract String[] getSubclassTableNames()
-
getSubclassTableKeyColumns
protected abstract String[] getSubclassTableKeyColumns(int j)
-
isClassOrSuperclassTable
protected abstract boolean isClassOrSuperclassTable(int j)
-
isClassOrSuperclassJoin
protected boolean isClassOrSuperclassJoin(int j)
-
getSubclassTableSpan
public abstract int getSubclassTableSpan()
-
getTableSpan
public abstract int getTableSpan()
-
hasDuplicateTables
public abstract boolean hasDuplicateTables()
-
getTableName
@Deprecated(since="6.2") public abstract String getTableName(int j)
Deprecated.Only ever used from places where we really want to useSelectStatement(select generator)InsertSelectStatementUpdateStatementDeleteStatement
-
getKeyColumns
public abstract String[] getKeyColumns(int j)
-
isPropertyOfTable
public abstract boolean isPropertyOfTable(int property, int j)
-
getPropertyTableNumbers
protected abstract int[] getPropertyTableNumbers()
-
getSubclassPropertyTableNumber
protected abstract int getSubclassPropertyTableNumber(int i)
-
getDiscriminatorColumnName
public String getDiscriminatorColumnName()
- Specified by:
getDiscriminatorColumnNamein interfaceLoadable- Returns:
- the column name for the discriminator as specified in the mapping.
-
getDiscriminatorColumnReaders
public String getDiscriminatorColumnReaders()
-
getDiscriminatorColumnReaderTemplate
public String getDiscriminatorColumnReaderTemplate()
-
getDiscriminatorAlias
public String getDiscriminatorAlias()
-
getDiscriminatorFormulaTemplate
public String getDiscriminatorFormulaTemplate()
-
isInverseTable
public boolean isInverseTable(int j)
-
isNullableTable
public boolean isNullableTable(int j)
-
isNullableSubclassTable
protected boolean isNullableSubclassTable(int j)
-
isSubclassEntityName
public boolean isSubclassEntityName(String entityName)
Description copied from interface:EntityPersisterDetermine whether the given name represents a subclass entity (or this entity itself) of the entity mapped by this persister.- Specified by:
isSubclassEntityNamein interfaceEntityPersister- Parameters:
entityName- The entity name to be checked.- Returns:
- True if the given entity name represents either the entity mapped by this persister or one of its subclass entities; false otherwise.
-
getTableHasColumns
protected boolean[] getTableHasColumns()
-
getRootTableKeyColumnNames
public String[] getRootTableKeyColumnNames()
Description copied from interface:PostInsertIdentityPersisterThe names of the primary key columns in the root table.- Specified by:
getRootTableKeyColumnNamesin interfacePostInsertIdentityPersister- Returns:
- The primary key column names.
-
getInsertCoordinator
public InsertCoordinator getInsertCoordinator()
-
getUpdateCoordinator
public UpdateCoordinator getUpdateCoordinator()
-
getDeleteCoordinator
public DeleteCoordinator getDeleteCoordinator()
-
getVersionSelectString
public String getVersionSelectString()
-
hasRowId
public boolean hasRowId()
Description copied from interface:LoadableDoes the result set contain rowids?
-
getPropertyColumnUpdateable
public boolean[][] getPropertyColumnUpdateable()
-
getPropertyColumnInsertable
public boolean[][] getPropertyColumnInsertable()
-
getTableNames
public String[] getTableNames()
-
buildCacheEntryHelper
protected AbstractEntityPersister.CacheEntryHelper buildCacheEntryHelper()
-
canUseReferenceCacheEntries
public boolean canUseReferenceCacheEntries()
- Specified by:
canUseReferenceCacheEntriesin interfaceEntityPersister
-
generateLazySelectStringsByFetchGroup
protected Map<String,SingleIdArrayLoadPlan> generateLazySelectStringsByFetchGroup()
-
getSqlAliasStem
public String getSqlAliasStem()
Description copied from interface:TableGroupProducerGet the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generatedNote that this is a metadata-ive value. It is only ever used internal to the producer producing its TableGroup.
- Specified by:
getSqlAliasStemin interfaceEntityMappingType- Specified by:
getSqlAliasStemin interfaceEntityPersister- Specified by:
getSqlAliasStemin interfaceTableGroupProducer- See Also:
SqlAliasBaseManager.createSqlAliasBase(java.lang.String)
-
containsTableReference
public boolean containsTableReference(String tableExpression)
- Specified by:
containsTableReferencein interfaceTableGroupProducer
-
getPartName
public String getPartName()
Description copied from interface:ModelPartThe local part name, which is generally the unqualified role name- Specified by:
getPartNamein interfaceEntityMappingType- Specified by:
getPartNamein interfaceModelPart
-
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
-
applySqlSelections
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)
Description copied from interface:ModelPartApply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelectionsin interfaceEntityValuedModelPart- Specified by:
applySqlSelectionsin interfaceModelPart
-
applySqlSelections
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection,JdbcMapping> selectionConsumer)
Description copied from interface:ModelPartApply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelectionsin interfaceEntityValuedModelPart- Specified by:
applySqlSelectionsin interfaceModelPart
-
getNaturalIdMapping
public NaturalIdMapping getNaturalIdMapping()
Description copied from interface:EntityMappingTypeThe mapping for the natural-id of the entity, if one is defined- Specified by:
getNaturalIdMappingin interfaceEntityMappingType
-
createRootTableGroup
public TableGroup createRootTableGroup(boolean canUseInnerJoins, NavigablePath navigablePath, String explicitSourceAlias, Supplier<Consumer<Predicate>> additionalPredicateCollectorAccess, SqlAliasBase sqlAliasBase, SqlExpressionResolver sqlExpressionResolver, FromClauseAccess fromClauseAccess, SqlAstCreationContext creationContext)
- Specified by:
createRootTableGroupin interfaceEntityMappingType- Specified by:
createRootTableGroupin interfaceRootTableGroupProducer
-
createPrimaryTableReference
public TableReference createPrimaryTableReference(SqlAliasBase sqlAliasBase, SqlExpressionResolver sqlExpressionResolver, SqlAstCreationContext creationContext)
- Specified by:
createPrimaryTableReferencein interfaceEntityMappingType
-
createTableReferenceJoin
public TableReferenceJoin createTableReferenceJoin(String joinTableExpression, SqlAliasBase sqlAliasBase, TableReference lhs, SqlExpressionResolver sqlExpressionResolver, SqlAstCreationContext creationContext)
- Specified by:
createTableReferenceJoinin interfaceEntityMappingType
-
generateTableReferenceJoin
protected TableReferenceJoin generateTableReferenceJoin(TableReference lhs, String joinTableExpression, SqlAliasBase sqlAliasBase, boolean innerJoin, String[] targetColumns, SqlExpressionResolver sqlExpressionResolver)
-
resolvePrimaryTableReference
protected TableReference resolvePrimaryTableReference(SqlAliasBase sqlAliasBase)
-
generateJoinPredicate
protected Predicate generateJoinPredicate(TableReference rootTableReference, TableReference joinedTableReference, String[] fkColumnNames, SqlExpressionResolver sqlExpressionResolver)
-
initializeLazyProperty
public Object initializeLazyProperty(String fieldName, Object entity, SharedSessionContractImplementor session)
Description copied from interface:LazyPropertyInitializerInitialize the property, and return its new value.- Specified by:
initializeLazyPropertyin interfaceLazyPropertyInitializer- Parameters:
fieldName- The name of the field being initializedentity- The entity on which the initialization is occurringsession- The session from which the initialization originated.- Returns:
- ?
-
getCollectionKey
public Object getCollectionKey(CollectionPersister persister, Object owner, EntityEntry ownerEntry, SharedSessionContractImplementor session)
-
initializeLazyPropertiesFromDatastore
protected Object initializeLazyPropertiesFromDatastore(Object entity, Object id, EntityEntry entry, String fieldName, SharedSessionContractImplementor session)
-
initializeLazyPropertiesFromCache
protected Object initializeLazyPropertiesFromCache(String fieldName, Object entity, SharedSessionContractImplementor session, EntityEntry entry, CacheEntry cacheEntry)
-
initializeLazyProperty
protected boolean initializeLazyProperty(String fieldName, Object entity, EntityEntry entry, int index, Object propValue)
-
getNavigableRole
public NavigableRole getNavigableRole()
Description copied from interface:MutationTargetThe model role of this target- Specified by:
getNavigableRolein interfaceModelPart- Specified by:
getNavigableRolein interfaceMutationTarget<EntityTableMapping>- See Also:
ModelPart.getPartName()
-
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- Returns:
- The query spaces.
-
isBatchLoadable
public boolean isBatchLoadable()
Description copied from interface:EntityPersisterIs batch loading enabled?- Specified by:
isBatchLoadablein interfaceEntityPersister
-
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
-
getIdentifierColumnReaders
public String[] getIdentifierColumnReaders()
-
getIdentifierColumnReaderTemplates
public String[] getIdentifierColumnReaderTemplates()
-
getIdentifierColumnSpan
public int getIdentifierColumnSpan()
-
getIdentifierAliases
public String[] getIdentifierAliases()
-
getVersionColumnName
public String getVersionColumnName()
Description copied from interface:LockableFor versioned entities, get the name of the column (again, expected on the root table) used to store the version values.- Specified by:
getVersionColumnNamein interfaceLockable- Returns:
- The version column name.
-
getVersionedTableName
public String getVersionedTableName()
-
isCacheInvalidationRequired
public boolean isCacheInvalidationRequired()
We can't immediately add to the cache if we have formulas which must be evaluated, or if we have the possibility of two concurrent updates to the same item being merged on the database. This second case can happen if:- the item is not versioned, and either
- we have dynamic update enabled, or
- the state of the item spans multiple tables.
- Specified by:
isCacheInvalidationRequiredin interfaceEntityPersister
-
isLazyPropertiesCacheable
public boolean isLazyPropertiesCacheable()
Description copied from interface:EntityPersisterShould lazy properties of this entity be cached?- Specified by:
isLazyPropertiesCacheablein interfaceEntityPersister
-
selectFragment
public String selectFragment(String alias, String suffix)
Description copied from interface:OuterJoinLoadableGenerate a list of collection index, key and element columns- Specified by:
selectFragmentin interfaceOuterJoinLoadable- Specified by:
selectFragmentin interfaceSQLLoadable
-
getIdentifierAliases
public String[] getIdentifierAliases(String suffix)
Description copied from interface:LoadableGet the result set aliases used for the identifier columns, given a suffix- Specified by:
getIdentifierAliasesin interfaceLoadable
-
getPropertyAliases
public String[] getPropertyAliases(String suffix, int i)
Description copied from interface:LoadableGet the result set aliases used for the property columns, given a suffix (properties of this class, only).- Specified by:
getPropertyAliasesin interfaceLoadable
-
getDiscriminatorAlias
public String getDiscriminatorAlias(String suffix)
Description copied from interface:LoadableGet the result set aliases used for the identifier columns, given a suffix- Specified by:
getDiscriminatorAliasin interfaceLoadable
-
getDatabaseSnapshot
public Object[] getDatabaseSnapshot(Object id, SharedSessionContractImplementor session) throws HibernateException
Description copied from interface:EntityPersisterGet the current database state of the object, in a "hydrated" form, without resolving identifiers.- Specified by:
getDatabaseSnapshotin interfaceEntityPersister- Returns:
- null if there is no row in the database
- Throws:
HibernateException
-
getIdByUniqueKey
public Object getIdByUniqueKey(Object key, String uniquePropertyName, SharedSessionContractImplementor session)
- Specified by:
getIdByUniqueKeyin interfaceEntityPersister
-
generateSelectVersionString
public String generateSelectVersionString()
Generate the SQL that selects the version number by id
-
forceVersionIncrement
public Object forceVersionIncrement(Object id, Object currentVersion, SharedSessionContractImplementor session)
- Specified by:
forceVersionIncrementin interfaceEntityPersister
-
getCurrentVersion
public Object getCurrentVersion(Object id, SharedSessionContractImplementor session) throws HibernateException
Retrieve the version number- Specified by:
getCurrentVersionin interfaceEntityPersister- Throws:
HibernateException
-
generateLocker
protected LockingStrategy generateLocker(LockMode lockMode)
-
lock
public void lock(Object id, Object version, Object object, LockMode lockMode, EventSource session) throws HibernateException
Description copied from interface:EntityPersisterDo a version check (optional operation)- Specified by:
lockin interfaceEntityPersister- Throws:
HibernateException
-
lock
public void lock(Object id, Object version, Object object, LockOptions lockOptions, EventSource session) throws HibernateException
Description copied from interface:EntityPersisterDo a version check (optional operation)- Specified by:
lockin interfaceEntityPersister- Throws:
HibernateException
-
getRootTableName
public String getRootTableName()
Description copied from interface:LockableLocks are always applied to the "root table".- Specified by:
getRootTableNamein interfaceLockable- Returns:
- The root table name
-
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- Parameters:
drivingAlias- The driving alias; or the alias for the table mapped by this persister in the hierarchy.- Returns:
- The root table alias.
-
getRootTableIdentifierColumnNames
public String[] getRootTableIdentifierColumnNames()
Description copied from interface:LockableGet the names of columns on the root table used to persist the identifier.- Specified by:
getRootTableIdentifierColumnNamesin interfaceLockable- Returns:
- The root table identifier column names.
-
toColumns
public String[] toColumns(String propertyName) throws QueryException
Given a property path, return the corresponding column name(s). Warning: When there are duplicated property names in the subclasses then this method may return the wrong results. To ensure correct results, this method should only be used when this is the concrete EntityPersister (since the concrete EntityPersister cannot have duplicated property names).- Specified by:
toColumnsin interfacePropertyMapping- Throws:
QueryException
-
toType
public Type toType(String propertyName) throws QueryException
Given a component path expression, get the type of the property Warning: When there are duplicated property names in the subclasses then this method may return the wrong results. To ensure correct results, this method should only be used when this is the concrete EntityPersister (since the concrete EntityPersister cannot have duplicated property names).- Specified by:
toTypein interfacePropertyMapping- Throws:
QueryException
-
getPropertyColumnNames
public String[] getPropertyColumnNames(String propertyName)
Get the column names for the given property path Warning: When there are duplicated property names in the subclasses then this method may return the wrong results. To ensure correct results, this method should only be used when this is the concrete EntityPersister (since the concrete EntityPersister cannot have duplicated property names).- Specified by:
getPropertyColumnNamesin interfaceOuterJoinLoadable
-
getSubclassPropertyTableNumber
public int getSubclassPropertyTableNumber(String propertyPath)
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.- Specified by:
getSubclassPropertyTableNumberin interfaceQueryable- Parameters:
propertyPath- The name of the property.- Returns:
- The number of the table to which the property is mapped.
-
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- Parameters:
propertyPath- The property name.- Returns:
- The property declarer
-
getPropertyTableName
public String getPropertyTableName(String propertyName)
Description copied from interface:OuterJoinLoadableGet the table name for the given property path- Specified by:
getPropertyTableNamein interfaceOuterJoinLoadable
-
getTypeDiscriminatorMetadata
public DiscriminatorMetadata getTypeDiscriminatorMetadata()
Description copied from interface:QueryableRetrieve the information needed to properly deal with this entity's discriminator in a query.- Specified by:
getTypeDiscriminatorMetadatain interfaceQueryable- Returns:
- The entity discriminator metadata
-
toColumns
public String[] toColumns(String name, int i)
Description copied from interface:OuterJoinLoadableGiven the number of a property of a subclass, and a table alias, return the aliased column names.- Specified by:
toColumnsin interfaceOuterJoinLoadable
-
getPropertyColumnNames
public String[] getPropertyColumnNames(int i)
Description copied from interface:LoadableGet the result set column names mapped for this property (properties of this class, only).- Specified by:
getPropertyColumnNamesin interfaceLoadable
-
getPropertyColumnWriters
public String[] getPropertyColumnWriters(int i)
-
getPropertyColumnSpan
public int getPropertyColumnSpan(int i)
-
hasFormulaProperties
public boolean hasFormulaProperties()
-
getFetchMode
public FetchMode getFetchMode(int i)
Description copied from interface:OuterJoinLoadableMay this (subclass closure) property be fetched using an SQL outerjoin?- Specified by:
getFetchModein interfaceOuterJoinLoadable
-
getCascadeStyle
public CascadeStyle getCascadeStyle(int i)
Description copied from interface:OuterJoinLoadableGet the cascade style of this (subclass closure) property- Specified by:
getCascadeStylein interfaceOuterJoinLoadable
-
getSubclassPropertyType
public Type getSubclassPropertyType(int i)
Description copied from interface:OuterJoinLoadableGet the type of the numbered property of the class or a subclass.- Specified by:
getSubclassPropertyTypein interfaceOuterJoinLoadable
-
getSubclassPropertyName
public String getSubclassPropertyName(int i)
Description copied from interface:OuterJoinLoadableGet the name of the numbered property of the class or a subclass.- Specified by:
getSubclassPropertyNamein interfaceOuterJoinLoadable
-
countSubclassProperties
public int countSubclassProperties()
Description copied from interface:OuterJoinLoadableHow many properties are there, for this class and all subclasses?- Specified by:
countSubclassPropertiesin interfaceOuterJoinLoadable
-
getSubclassPropertyColumnNames
public String[] getSubclassPropertyColumnNames(int i)
Description copied from interface:OuterJoinLoadableReturn the column names used to persist the numbered property of the class or a subclass.- Specified by:
getSubclassPropertyColumnNamesin interfaceOuterJoinLoadable
-
isDefinedOnSubclass
public boolean isDefinedOnSubclass(int i)
Description copied from interface:OuterJoinLoadableIs this property defined on a subclass of the mapped class.- Specified by:
isDefinedOnSubclassin interfaceOuterJoinLoadable
-
getSubclassPropertyFormulaTemplateClosure
public String[][] getSubclassPropertyFormulaTemplateClosure()
- Specified by:
getSubclassPropertyFormulaTemplateClosurein interfaceQueryable
-
getSubclassPropertyTypeClosure
protected Type[] getSubclassPropertyTypeClosure()
-
getSubclassPropertyColumnNameClosure
protected String[][] getSubclassPropertyColumnNameClosure()
-
getSubclassPropertyColumnReaderClosure
public String[][] getSubclassPropertyColumnReaderClosure()
-
getSubclassPropertyColumnReaderTemplateClosure
public String[][] getSubclassPropertyColumnReaderTemplateClosure()
-
getSubclassPropertyNameClosure
protected String[] getSubclassPropertyNameClosure()
-
resolveAttributeIndexes
public int[] resolveAttributeIndexes(String[] attributeNames)
Description copied from interface:EntityPersisterConverts an array of attribute names to a set of indexes, according to the entity metamodel- Specified by:
resolveAttributeIndexesin interfaceEntityPersister- Parameters:
attributeNames- Array of names to be resolved- Returns:
- A set of unique indexes of the attribute names found in the metamodel
-
resolveDirtyAttributeIndexes
public int[] resolveDirtyAttributeIndexes(Object[] currentState, Object[] previousState, String[] attributeNames, SessionImplementor session)
Description copied from interface:EntityPersisterLikeEntityPersister.resolveAttributeIndexes(String[])but also always returns mutable attributes- Specified by:
resolveDirtyAttributeIndexesin interfaceEntityPersisterattributeNames- Array of names to be resolved- Returns:
- A set of unique indexes of the attribute names found in the metamodel
-
getSubclassColumnAliasClosure
protected String[] getSubclassColumnAliasClosure()
-
getSubclassFormulaAliasClosure
protected String[] getSubclassFormulaAliasClosure()
-
getSubclassPropertyColumnAliases
public String[] getSubclassPropertyColumnAliases(String propertyName, String suffix)
Description copied from interface:SQLLoadableReturn the column alias names used to persist/query the named property of the class or a subclass (optional operation).- Specified by:
getSubclassPropertyColumnAliasesin interfaceSQLLoadable
-
getSubclassPropertyColumnNames
public String[] getSubclassPropertyColumnNames(String propertyName)
Description copied from interface:SQLLoadableReturn the column names used to persist/query the named property of the class or a subclass (optional operation).- Specified by:
getSubclassPropertyColumnNamesin interfaceSQLLoadable
-
initSubclassPropertyAliasesMap
protected void initSubclassPropertyAliasesMap(PersistentClass model) throws MappingException
Must be called by subclasses, at the end of their constructors- Throws:
MappingException
-
getLazyPropertyColumnAliases
protected String[][] getLazyPropertyColumnAliases()
-
loadByUniqueKey
public Object loadByUniqueKey(String propertyName, Object uniqueKey, SharedSessionContractImplementor session) throws HibernateException
Description copied from interface:UniqueKeyLoadableLoad an instance of the persistent class, by a unique key other than the primary key.- Specified by:
loadByUniqueKeyin interfaceUniqueKeyLoadable- Throws:
HibernateException
-
loadByUniqueKey
public Object loadByUniqueKey(String propertyName, Object uniqueKey, Boolean readOnly, SharedSessionContractImplementor session) throws HibernateException
- Throws:
HibernateException
-
getUniqueKeyLoader
protected SingleUniqueKeyEntityLoader<?> getUniqueKeyLoader(String attributeName)
-
getPropertyIndex
public int getPropertyIndex(String propertyName)
Description copied from interface:UniqueKeyLoadableGet the property number of the unique key property- Specified by:
getPropertyIndexin interfaceAttributeSource- Specified by:
getPropertyIndexin interfaceUniqueKeyLoadable
-
initPropertyPaths
protected void initPropertyPaths(Metadata mapping) throws MappingException
- Throws:
MappingException
-
check
protected boolean check(int rows, Object id, int tableNumber, Expectation expectation, PreparedStatement statement, String statementSQL) throws HibernateException- Throws:
HibernateException
-
checkVersion
public final boolean checkVersion(boolean[] includeProperty)
-
getIdentitySelectString
public String getIdentitySelectString()
Description copied from interface:PostInsertIdentityPersisterGet the database-specific SQL command to retrieve the last generated IDENTITY value.- Specified by:
getIdentitySelectStringin interfacePostInsertIdentityPersister- Returns:
- The SQL command string
-
getSelectByUniqueKeyString
public String getSelectByUniqueKeyString(String propertyName)
Description copied from interface:PostInsertIdentityPersisterGet a SQL select string that performs a select based on a unique key determined by the given property name.- Specified by:
getSelectByUniqueKeyStringin interfacePostInsertIdentityPersister- Parameters:
propertyName- The name of the property which maps to the column(s) to use in the select statement restriction.- Returns:
- The SQL select string
-
getSelectByUniqueKeyString
public String getSelectByUniqueKeyString(String[] propertyNames)
Description copied from interface:PostInsertIdentityPersisterGet a SQL select string that performs a select based on a unique key determined by the given property names.- Specified by:
getSelectByUniqueKeyStringin interfacePostInsertIdentityPersister- Parameters:
propertyNames- The names of the properties which maps to the column(s) to use in the select statement restriction.- Returns:
- The SQL select string
-
update
public void update(Object id, Object[] values, int[] dirtyAttributeIndexes, boolean hasDirtyCollection, Object[] oldValues, Object oldVersion, Object object, Object rowId, SharedSessionContractImplementor session) throws HibernateException
Update an object- Specified by:
updatein interfaceEntityPersister- Throws:
HibernateException
-
hasLazyDirtyFields
public boolean hasLazyDirtyFields(int[] dirtyFields)
-
getIdentityInsertDelegate
public InsertGeneratedIdentifierDelegate getIdentityInsertDelegate()
Description copied from interface:EntityMutationTargetThe delegate for executing inserts against the root table for targets defined using post-insert id generation- Specified by:
getIdentityInsertDelegatein interfaceEntityMutationTarget
-
insert
public Object insert(Object[] fields, Object object, SharedSessionContractImplementor session)
Description copied from interface:EntityPersisterPersist an instance, using a natively generated identifier (optional operation)- Specified by:
insertin interfaceEntityPersister
-
insert
public void insert(Object id, Object[] fields, Object object, SharedSessionContractImplementor session)
Description copied from interface:EntityPersisterPersist an instance- Specified by:
insertin interfaceEntityPersister
-
getTableMappings
protected EntityTableMapping[] getTableMappings()
-
getTableMappingsCount
public int getTableMappingsCount()
-
getTableMapping
public EntityTableMapping getTableMapping(int i)
-
physicalTableNameForMutation
public String physicalTableNameForMutation(SelectableMapping selectableMapping)
Unfortunately we cannot directly use `SelectableMapping#getContainingTableExpression()` as that blows up for attributes declared on super-type for union-subclass mappings
-
getPhysicalTableMappingForMutation
public EntityTableMapping getPhysicalTableMappingForMutation(SelectableMapping selectableMapping)
-
getTargetPart
public EntityMappingType getTargetPart()
Description copied from interface:MutationTargetThe ModelPart describing the mutation target- Specified by:
getTargetPartin interfaceEntityMutationTarget- Specified by:
getTargetPartin interfaceMutationTarget<EntityTableMapping>
-
forEachMutableTable
public void forEachMutableTable(Consumer<EntityTableMapping> consumer)
Description copied from interface:MutationTargetVisit each table.- Specified by:
forEachMutableTablein interfaceMutationTarget<EntityTableMapping>
-
forEachMutableTableReverse
public void forEachMutableTableReverse(Consumer<EntityTableMapping> consumer)
Description copied from interface:MutationTargetSame asMutationTarget.forEachMutableTable(java.util.function.Consumer<T>)except that here the tables are visited in reverse order- Specified by:
forEachMutableTableReversein interfaceMutationTarget<EntityTableMapping>
-
getIdentifierTableName
public String getIdentifierTableName()
Description copied from interface:MutationTargetThe name of the table defining the identifier for this target- Specified by:
getIdentifierTableNamein interfaceMutationTarget<EntityTableMapping>
-
getIdentifierTableMapping
public EntityTableMapping getIdentifierTableMapping()
Description copied from interface:MutationTargetThe descriptor for the table containing the identifier for the target- Specified by:
getIdentifierTableMappingin interfaceEntityMutationTarget- Specified by:
getIdentifierTableMappingin interfaceMutationTarget<EntityTableMapping>
-
getIdentifierDescriptor
public ModelPart getIdentifierDescriptor()
Description copied from interface:EntityMutationTargetThe ModelPart describing the identifier/key for this target- Specified by:
getIdentifierDescriptorin interfaceEntityMutationTarget
-
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- See Also:
Table.inverse(),Table.optional()
-
hasAnySkippableTables
protected boolean hasAnySkippableTables(boolean[] optionalTables, boolean[] inverseTables)
-
delete
public void delete(Object id, Object version, Object object, SharedSessionContractImplementor session)
Delete an object- Specified by:
deletein interfaceEntityPersister
-
isAllOrDirtyOptLocking
protected boolean isAllOrDirtyOptLocking()
-
logStaticSQL
protected void logStaticSQL()
-
applyDiscriminator
public void applyDiscriminator(Consumer<Predicate> predicateConsumer, String alias, TableGroup tableGroup, SqlAstCreationState creationState)
Description copied from interface:DiscriminatableApply the discriminator as a predicate via thepredicateConsumer- Specified by:
applyDiscriminatorin interfaceDiscriminatable- Specified by:
applyDiscriminatorin interfaceEntityMappingType
-
applyFilterRestrictions
public void applyFilterRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String,Filter> enabledFilters, SqlAstCreationState creationState)
Description copied from interface:FilterRestrictableApplies just theFiltervalues enabled for the associated entity- Specified by:
applyFilterRestrictionsin interfaceEntityMappingType- Specified by:
applyFilterRestrictionsin interfaceFilterRestrictable
-
applyBaseRestrictions
public void applyBaseRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String,Filter> enabledFilters, Set<String> treatAsDeclarations, SqlAstCreationState creationState)
Description copied from interface:RestrictableApplies the base set of restrictions.- Specified by:
applyBaseRestrictionsin interfaceEntityMappingType- Specified by:
applyBaseRestrictionsin interfaceRestrictable
-
applyWhereRestrictions
public void applyWhereRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, SqlAstCreationState creationState)
Description copied from interface:WhereRestrictableApply theWhererestrictions- Specified by:
applyWhereRestrictionsin interfaceEntityMappingType- Specified by:
applyWhereRestrictionsin interfaceWhereRestrictable
-
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- Parameters:
rootAlias- The root alias- Returns:
- The alias used for "filter conditions" within the where clause.
-
shouldInnerJoinSubclassTable
protected boolean shouldInnerJoinSubclassTable(int subclassTableNumber, Set<String> treatAsDeclarations)
-
isSubclassTableIndicatedByTreatAsDeclarations
protected boolean isSubclassTableIndicatedByTreatAsDeclarations(int subclassTableNumber, Set<String> treatAsDeclarations)
-
postConstruct
protected void postConstruct(Metadata mapping) throws MappingException
Post-construct is a callback for AbstractEntityPersister subclasses to call after they are all done with their constructor processing. It allows AbstractEntityPersister to extend its construction after all subclass-specific details have been handled.- Parameters:
mapping- The mapping- Throws:
MappingException- Indicates a problem accessing the Mapping
-
buildTableMappings
protected EntityTableMapping[] buildTableMappings()
Builds the EntityTableMapping descriptors for the tables mapped by this entity.
-
visitMutabilityOrderedTables
protected abstract void visitMutabilityOrderedTables(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. Used while building the table-mapping descriptors for each table.
-
isIdentifierTable
protected abstract boolean isIdentifierTable(String tableExpression)
-
buildInsertCoordinator
protected InsertCoordinator buildInsertCoordinator()
-
buildUpdateCoordinator
protected UpdateCoordinator buildUpdateCoordinator()
-
buildDeleteCoordinator
protected DeleteCoordinator buildDeleteCoordinator()
-
addDiscriminatorToInsertGroup
public void addDiscriminatorToInsertGroup(MutationGroupBuilder insertGroupBuilder)
-
postInstantiate
public final void postInstantiate() throws MappingExceptionDescription copied from interface:EntityPersisterFinish the initialization of this object.The method
InFlightEntityMappingType.prepareMappingModel(org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess)must have been called for every entity persister before this method is invoked.Called only once per
SessionFactorylifecycle, after all entity persisters have been instantiated.- Specified by:
postInstantiatein interfaceEntityPersister- Throws:
MappingException- Indicates an issue in the metadata.
-
load
public Object load(Object id, Object optionalObject, LockMode lockMode, SharedSessionContractImplementor session)
Load an instance using either theforUpdateLoaderor the outer joiningloader, depending upon the value of thelockparameter- Specified by:
loadin interfaceEntityPersister
-
load
public Object load(Object id, Object optionalObject, LockOptions lockOptions, SharedSessionContractImplementor session) throws HibernateException
Load an instance using either theforUpdateLoaderor the outer joiningloader, depending upon the value of thelockparameter- Specified by:
loadin interfaceEntityPersister- Throws:
HibernateException
-
load
public Object load(Object id, Object optionalObject, LockOptions lockOptions, SharedSessionContractImplementor session, Boolean readOnly) throws HibernateException
- Specified by:
loadin interfaceEntityPersister- Throws:
HibernateException
-
getSingleIdEntityLoader
public SingleIdEntityLoader<?> getSingleIdEntityLoader()
-
initializeEnhancedEntityUsedAsProxy
public Object initializeEnhancedEntityUsedAsProxy(Object entity, String nameOfAttributeBeingAccessed, SharedSessionContractImplementor session)
Description copied from interface:EntityPersisterCalled fromEnhancementAsProxyLazinessInterceptorto trigger load of the entity's non-lazy state as well as the named attribute we are accessing if it is still uninitialized after fetching non-lazy state.- Specified by:
initializeEnhancedEntityUsedAsProxyin interfaceEntityPersister
-
multiLoad
public List<?> multiLoad(Object[] ids, EventSource session, MultiIdLoadOptions loadOptions)
Description copied from interface:EntityPersisterPerforms a load of multiple entities (of this type) by identifier simultaneously.- Specified by:
multiLoadin interfaceEntityPersister- Parameters:
ids- The identifiers to loadsession- The originating SessionloadOptions- The options for loading- Returns:
- The loaded, matching entities
-
registerAffectingFetchProfile
public void registerAffectingFetchProfile(String fetchProfileName)
Description copied from interface:LoadableRegister the name of a fetch profile determined to have an affect on the underlying loadable in regards to the fact that the underlying load SQL needs to be adjust when the given fetch profile is enabled.- Specified by:
registerAffectingFetchProfilein interfaceLoadable- Parameters:
fetchProfileName- The name of the profile affecting this.
-
isAffectedByEntityGraph
public boolean isAffectedByEntityGraph(LoadQueryInfluencers loadQueryInfluencers)
Description copied from interface:LoadableWhether the effective entity-graph applies to this loadable- Specified by:
isAffectedByEntityGraphin interfaceEntityMappingType- Specified by:
isAffectedByEntityGraphin interfaceLoadable
-
isAffectedByEnabledFetchProfiles
public boolean isAffectedByEnabledFetchProfiles(LoadQueryInfluencers loadQueryInfluencers)
Description copied from interface:LoadableWhether any of the LoadQueryInfluencers.getEnabledFetchProfileNames() apply to this loadable- Specified by:
isAffectedByEnabledFetchProfilesin interfaceEntityMappingType- Specified by:
isAffectedByEnabledFetchProfilesin interfaceLoadable
-
isAffectedByEnabledFilters
public boolean isAffectedByEnabledFilters(LoadQueryInfluencers loadQueryInfluencers)
Description copied from interface:LoadableWhether any of the "influencers" affect this loadable.- Specified by:
isAffectedByEnabledFiltersin interfaceEntityMappingType- Specified by:
isAffectedByEnabledFiltersin interfaceLoadable
-
isSubclassPropertyNullable
public boolean isSubclassPropertyNullable(int i)
Description copied from interface:OuterJoinLoadableIs the numbered property of the class of subclass nullable?- Specified by:
isSubclassPropertyNullablein interfaceOuterJoinLoadable
-
findDirty
public int[] findDirty(Object[] currentState, Object[] previousState, Object entity, SharedSessionContractImplementor session) throws HibernateException
Locate the property-indices of all properties considered to be dirty.- Specified by:
findDirtyin interfaceEntityPersister- Parameters:
currentState- The current state of the entity (the state to be checked).previousState- The previous state of the entity (the state to be checked against).entity- The entity for which we are checking state dirtiness.session- The session in which the check is occurring.- Returns:
nullor the indices of the dirty properties- Throws:
HibernateException
-
findModified
public int[] findModified(Object[] old, Object[] current, Object entity, SharedSessionContractImplementor session) throws HibernateException
Locate the property-indices of all properties considered to be dirty.- Specified by:
findModifiedin interfaceEntityPersister- Parameters:
old- The old state of the entity.current- The current state of the entity.entity- The entity for which we are checking state modification.session- The session in which the check is occurring.- Returns:
nullor the indices of the modified properties- Throws:
HibernateException
-
getPropertyUpdateability
public boolean[] getPropertyUpdateability(Object entity)
Which properties appear in the SQL update? (Initialized, updateable ones!)
-
getFactory
public SessionFactoryImplementor getFactory()
Description copied from interface:EntityPersisterReturn theSessionFactoryto which this persister belongs.- Specified by:
getFactoryin interfaceEntityPersister- Returns:
- The owning
SessionFactory.
-
getEntityMetamodel
public EntityMetamodel getEntityMetamodel()
Description copied from interface:EntityPersisterRetrieve the underlying entity metamodel instance.- Specified by:
getEntityMetamodelin interfaceEntityPersister- Returns:
- The metamodel
-
canReadFromCache
public boolean canReadFromCache()
- Specified by:
canReadFromCachein interfaceEntityPersister
-
canWriteToCache
public boolean canWriteToCache()
- Specified by:
canWriteToCachein interfaceEntityPersister
-
hasCache
public boolean hasCache()
Description copied from interface:EntityPersisterDoes this class have a cache.- Specified by:
hasCachein interfaceEntityPersister
-
getCacheAccessStrategy
public EntityDataAccess getCacheAccessStrategy()
Description copied from interface:EntityPersisterGet the cache (optional operation)- Specified by:
getCacheAccessStrategyin interfaceEntityPersister
-
getCacheEntryStructure
public CacheEntryStructure getCacheEntryStructure()
Description copied from interface:EntityPersisterGet the cache structure- Specified by:
getCacheEntryStructurein interfaceEntityPersister
-
buildCacheEntry
public CacheEntry buildCacheEntry(Object entity, Object[] state, Object version, SharedSessionContractImplementor session)
- Specified by:
buildCacheEntryin interfaceEntityPersister
-
hasNaturalIdCache
public boolean hasNaturalIdCache()
Description copied from interface:EntityPersisterDoes this class have a natural id cache- Specified by:
hasNaturalIdCachein interfaceEntityPersister
-
getNaturalIdCacheAccessStrategy
public NaturalIdDataAccess getNaturalIdCacheAccessStrategy()
Description copied from interface:EntityPersisterGet the NaturalId cache (optional operation)- Specified by:
getNaturalIdCacheAccessStrategyin interfaceEntityPersister
-
getEntityName
public final String getEntityName()
Description copied from interface:EntityPersisterThe entity name which this persister maps.- Specified by:
getEntityNamein interfaceClassMetadata- Specified by:
getEntityNamein interfaceEntityMappingType- Specified by:
getEntityNamein interfaceEntityPersister- Returns:
- The name of the entity which this persister maps.
-
getEntityType
public EntityType getEntityType()
- Specified by:
getEntityTypein interfaceOuterJoinLoadable
-
isPolymorphic
public boolean isPolymorphic()
-
isInherited
public boolean isInherited()
Description copied from interface:EntityPersisterDetermine whether the entity is inherited one or more other entities. In other words, is this entity a subclass of other entities.- Specified by:
isInheritedin interfaceClassMetadata- Specified by:
isInheritedin interfaceEntityPersister- Returns:
- True if other entities extend this entity; false otherwise.
-
hasCascades
public boolean hasCascades()
Description copied from interface:EntityPersisterDetermine whether this entity has any (non-none) cascading.- Specified by:
hasCascadesin interfaceEntityPersister- Returns:
- True if the entity has any properties with a cascade other than NONE; false otherwise (aka, no cascading).
-
hasCascadeDelete
public boolean hasCascadeDelete()
Description copied from interface:EntityPersisterDetermine whether this entity has any delete cascading.- Specified by:
hasCascadeDeletein interfaceEntityPersister- Returns:
- True if the entity has any properties with a cascade other than NONE; false otherwise.
-
hasOwnedCollections
public boolean hasOwnedCollections()
Description copied from interface:EntityPersisterDetermine whether this entity has any owned collections.- Specified by:
hasOwnedCollectionsin interfaceEntityPersister- Returns:
- True if the entity has an owned collection; false otherwise.
-
hasIdentifierProperty
public boolean hasIdentifierProperty()
Description copied from interface:EntityPersisterDetermine whether the entity has a particular property holding the identifier value.- Specified by:
hasIdentifierPropertyin interfaceClassMetadata- Specified by:
hasIdentifierPropertyin interfaceEntityPersister- Returns:
- True if the entity has a specific property holding identifier value.
-
getVersionType
public BasicType<?> getVersionType()
Description copied from interface:EntityPersisterIfEntityPersister.isVersioned(), then what is the type of the property holding the locking value.- Specified by:
getVersionTypein interfaceEntityPersister- Returns:
- The type of the version property; or null, if not versioned.
-
getVersionProperty
public int getVersionProperty()
Description copied from interface:EntityPersisterIfEntityPersister.isVersioned(), then what is the index of the property holding the locking value.- Specified by:
getVersionPropertyin interfaceClassMetadata- Specified by:
getVersionPropertyin interfaceEntityPersister- Returns:
- The type of the version property; or -66, if not versioned.
-
isVersioned
public boolean isVersioned()
Description copied from interface:EntityPersisterDetermine whether optimistic locking by column is enabled for this entity.- Specified by:
isVersionedin interfaceClassMetadata- Specified by:
isVersionedin interfaceEntityPersister- Returns:
- True if optimistic locking by column (i.e.,
<version/>or<timestamp/>) is enabled; false otherwise.
-
isIdentifierAssignedByInsert
public boolean isIdentifierAssignedByInsert()
Description copied from interface:EntityPersisterAre identifiers of this entity assigned known before the insert execution? Or, are they generated (in the database) by the insert execution.- Specified by:
isIdentifierAssignedByInsertin interfaceEntityPersister- Returns:
- True if identifiers for this entity are generated by the insert execution.
-
hasLazyProperties
public boolean hasLazyProperties()
Description copied from interface:EntityPersisterDetermine whether this entity defines any lazy properties (when bytecode instrumentation is enabled).- Specified by:
hasLazyPropertiesin interfaceEntityPersister- Returns:
- True if the entity has properties mapped as lazy; false otherwise.
-
afterReassociate
public void afterReassociate(Object entity, SharedSessionContractImplementor session)
Description copied from interface:EntityPersisterCalled just after the entity has been reassociated with the session- Specified by:
afterReassociatein interfaceEntityPersister
-
isTransient
public Boolean isTransient(Object entity, SharedSessionContractImplementor session) throws HibernateException
Description copied from interface:EntityPersisterIs this a new transient instance?- Specified by:
isTransientin interfaceEntityPersister- Throws:
HibernateException
-
hasCollections
public boolean hasCollections()
Description copied from interface:EntityPersisterDetermine whether this entity contains references to persistent collections.- Specified by:
hasCollectionsin interfaceEntityPersister- Returns:
- True if the entity does contain persistent collections; false otherwise.
-
hasMutableProperties
public boolean hasMutableProperties()
Description copied from interface:EntityPersisterDetermine whether any properties of this entity are considered mutable.- Specified by:
hasMutablePropertiesin interfaceEntityPersister- Returns:
- True if any properties of the entity are mutable; false otherwise (meaning none are).
-
isMutable
public boolean isMutable()
Description copied from interface:EntityPersisterDetermine whether instances of this entity are considered mutable.- Specified by:
isMutablein interfaceClassMetadata- Specified by:
isMutablein interfaceEntityPersister- Returns:
- True if the entity is considered mutable; false otherwise.
-
isAbstract
public boolean isAbstract()
Description copied from interface:EntityMappingTypeWhether this entity is defined as abstract using the Javaabstractkeyword- Specified by:
isAbstractin interfaceEntityMappingType- Specified by:
isAbstractin interfaceLoadable- Specified by:
isAbstractin interfaceQueryable- See Also:
EntityMappingType.isAbstract()
-
hasSubclasses
public boolean hasSubclasses()
Description copied from interface:LoadableDoes this persistent class have subclasses?- Specified by:
hasSubclassesin interfaceClassMetadata- Specified by:
hasSubclassesin interfaceEntityMappingType- Specified by:
hasSubclassesin interfaceLoadable
-
hasProxy
public boolean hasProxy()
Description copied from interface:EntityPersisterDetermine whether this entity supports dynamic proxies.- Specified by:
hasProxyin interfaceClassMetadata- Specified by:
hasProxyin interfaceEntityPersister- Returns:
- True if the entity has dynamic proxy support; false otherwise.
-
getIdentifierGenerator
@Deprecated public IdentifierGenerator getIdentifierGenerator() throws HibernateException
Deprecated.Description copied from interface:EntityPersisterDetermine which identifier generation strategy is used for this entity.- Specified by:
getIdentifierGeneratorin interfaceEntityPersister- Returns:
- The identifier generation strategy.
- Throws:
HibernateException
-
getGenerator
public Generator getGenerator()
- Specified by:
getGeneratorin interfaceEntityPersister
-
getVersionGenerator
public BeforeExecutionGenerator getVersionGenerator()
- Specified by:
getVersionGeneratorin interfaceEntityPersister
-
getRootEntityName
public String getRootEntityName()
Description copied from interface:EntityPersisterReturns an object that identifies the space in which identifiers of this entity hierarchy are unique. Might be a table name, a JNDI URL, etc.- Specified by:
getRootEntityNamein interfaceEntityPersister- Returns:
- The root entity name.
-
getClassMetadata
@Deprecated public ClassMetadata getClassMetadata()
Deprecated.Description copied from interface:EntityPersisterGet the user-visible metadata for the class (optional operation)- Specified by:
getClassMetadatain interfaceEntityPersister
-
getMappedSuperclass
public String getMappedSuperclass()
Description copied from interface:EntityMappingTypeGet the name of the entity that is the "super class" for this entity- Specified by:
getMappedSuperclassin interfaceEntityMappingType- Specified by:
getMappedSuperclassin interfaceQueryable- See Also:
EntityMappingType.getSuperMappingType()
-
isExplicitPolymorphism
public boolean isExplicitPolymorphism()
Description copied from interface:EntityMappingTypeIs this class explicit polymorphism only?- Specified by:
isExplicitPolymorphismin interfaceEntityMappingType- Specified by:
isExplicitPolymorphismin interfaceQueryable- See Also:
EntityMappingType.isExplicitPolymorphism()
-
getKeyColumnNames
public String[] getKeyColumnNames()
Description copied from interface:JoinableThe columns to join on- Specified by:
getKeyColumnNamesin interfaceJoinable
-
getName
public String getName()
Description copied from interface:JoinableAn identifying name; a class name or collection role name.
-
isCollection
public boolean isCollection()
Description copied from interface:JoinableIs this instance actually a CollectionPersister?- Specified by:
isCollectionin interfaceJoinable
-
consumesEntityAlias
public boolean consumesEntityAlias()
Description copied from interface:JoinableVery, very, very ugly...- Specified by:
consumesEntityAliasin interfaceJoinable- Returns:
- Does this persister "consume" entity column aliases in the result set?
-
consumesCollectionAlias
public boolean consumesCollectionAlias()
Description copied from interface:JoinableVery, very, very ugly...- Specified by:
consumesCollectionAliasin interfaceJoinable- Returns:
- Does this persister "consume" collection column aliases in the result set?
-
getPropertyType
public Type getPropertyType(String propertyName) throws MappingException
Get the type of a particular property by name. Warning: When there are duplicated property names in the subclasses then this method may return the wrong results. To ensure correct results, this method should only be used when this is the concrete EntityPersister (since the concrete EntityPersister cannot have duplicated property names).- Specified by:
getPropertyTypein interfaceClassMetadata- Specified by:
getPropertyTypein interfaceEntityPersister- Parameters:
propertyName- The name of the property for which to retrieve the type.- Returns:
- The type.
- Throws:
MappingException- Typically indicates an unknown property name.
-
getType
public Type getType()
Description copied from interface:SQLLoadableGet the type- Specified by:
getTypein interfaceSQLLoadable
-
isSelectBeforeUpdateRequired
public boolean isSelectBeforeUpdateRequired()
Description copied from interface:EntityPersisterIs select snapshot before update enabled?- Specified by:
isSelectBeforeUpdateRequiredin interfaceEntityPersister
-
optimisticLockStyle
public final OptimisticLockStyle optimisticLockStyle()
Description copied from interface:EntityMappingTypeThe type of optimistic locking, if any, defined for this entity mapping- Specified by:
optimisticLockStylein interfaceEntityMappingType
-
createProxy
public Object createProxy(Object id, SharedSessionContractImplementor session) throws HibernateException
Description copied from interface:EntityPersisterCreate a new proxy instance- Specified by:
createProxyin interfaceEntityPersister- Throws:
HibernateException
-
isInstrumented
public boolean isInstrumented()
Description copied from interface:EntityPersisterHas the class actually been bytecode instrumented?- Specified by:
isInstrumentedin interfaceEntityPersister
-
hasInsertGeneratedProperties
public boolean hasInsertGeneratedProperties()
Description copied from interface:EntityPersisterDoes this entity define any properties as being database generated on insert?- Specified by:
hasInsertGeneratedPropertiesin interfaceEntityPersister- Returns:
- True if this entity contains at least one property defined as generated (including version property, but not identifier).
-
hasUpdateGeneratedProperties
public boolean hasUpdateGeneratedProperties()
Description copied from interface:EntityPersisterDoes this entity define any properties as being database generated on update?- Specified by:
hasUpdateGeneratedPropertiesin interfaceEntityPersister- Returns:
- True if this entity contains at least one property defined as generated (including version property, but not identifier).
-
isVersionPropertyGenerated
public boolean isVersionPropertyGenerated()
Description copied from interface:EntityPersisterDoes this entity contain a version property that is defined to be database generated?- Specified by:
isVersionPropertyGeneratedin interfaceEntityPersister- Returns:
- true if this entity contains a version property and that property has been marked as generated.
-
isVersionPropertyInsertable
public boolean isVersionPropertyInsertable()
Description copied from interface:QueryableIs the version property included in insert statements?- Specified by:
isVersionPropertyInsertablein interfaceQueryable
-
isVersionGeneratedOnExecution
public boolean isVersionGeneratedOnExecution()
-
isVersionGeneratedBeforeExecution
public boolean isVersionGeneratedBeforeExecution()
-
afterInitialize
public void afterInitialize(Object entity, SharedSessionContractImplementor session)
Description copied from interface:EntityPersisterCalled just after the entities properties have been initialized- Specified by:
afterInitializein interfaceEntityPersister
-
getPropertyNames
public String[] getPropertyNames()
Description copied from interface:EntityPersisterGet the names of the class properties - doesn't have to be the names of the actual Java properties (used for XML generation only)- Specified by:
getPropertyNamesin interfaceClassMetadata- Specified by:
getPropertyNamesin interfaceEntityPersister
-
getPropertyTypes
public Type[] getPropertyTypes()
Description copied from interface:EntityPersisterGet the Hibernate types of the class properties- Specified by:
getPropertyTypesin interfaceClassMetadata- Specified by:
getPropertyTypesin interfaceEntityPersister
-
getPropertyLaziness
public boolean[] getPropertyLaziness()
Description copied from interface:ClassMetadataGet the "laziness" of the properties of this class- Specified by:
getPropertyLazinessin interfaceClassMetadata- Specified by:
getPropertyLazinessin interfaceEntityPersister
-
getPropertyUpdateability
public boolean[] getPropertyUpdateability()
Description copied from interface:EntityPersisterGet the "updateability" of the properties of this class (does the property appear in an SQL UPDATE)- Specified by:
getPropertyUpdateabilityin interfaceEntityPersister
-
getPropertyCheckability
public boolean[] getPropertyCheckability()
Description copied from interface:EntityPersisterGet the "checkability" of the properties of this class (is the property dirty checked, does the cache need to be updated)- Specified by:
getPropertyCheckabilityin interfaceEntityPersister
-
getNonLazyPropertyUpdateability
public boolean[] getNonLazyPropertyUpdateability()
-
getPropertyInsertability
public boolean[] getPropertyInsertability()
Description copied from interface:EntityPersisterGet the "insertability" of the properties of this class (does the property appear in an SQL INSERT)- Specified by:
getPropertyInsertabilityin interfaceEntityPersister
-
getPropertyNullability
public boolean[] getPropertyNullability()
Description copied from interface:EntityPersisterGet the nullability of the properties of this class- Specified by:
getPropertyNullabilityin interfaceClassMetadata- Specified by:
getPropertyNullabilityin interfaceEntityPersister
-
getPropertyVersionability
public boolean[] getPropertyVersionability()
Description copied from interface:EntityPersisterGet the "versionability" of the properties of this class (is the property optimistic-locked)- Specified by:
getPropertyVersionabilityin interfaceEntityPersister
-
getPropertyCascadeStyles
public CascadeStyle[] getPropertyCascadeStyles()
Description copied from interface:EntityPersisterGet the cascade styles of the properties (optional operation)- Specified by:
getPropertyCascadeStylesin interfaceEntityPersister
-
getMappedClass
public final Class<?> getMappedClass()
Description copied from interface:EntityPersisterThe persistent class, or null- Specified by:
getMappedClassin interfaceClassMetadata- Specified by:
getMappedClassin interfaceEntityPersister
-
implementsLifecycle
public boolean implementsLifecycle()
Description copied from interface:EntityPersisterDoes the class implement theLifecycleinterface?- Specified by:
implementsLifecyclein interfaceClassMetadata- Specified by:
implementsLifecyclein interfaceEntityPersister
-
getConcreteProxyClass
public Class<?> getConcreteProxyClass()
Description copied from interface:EntityPersisterGet the proxy interface that instances of this concrete class will be cast to (optional operation).- Specified by:
getConcreteProxyClassin interfaceEntityPersister
-
setPropertyValues
public void setPropertyValues(Object object, Object[] values)
Description copied from interface:EntityPersisterSet the given values to the mapped properties of the given object.- Specified by:
setPropertyValuesin interfaceClassMetadata- Specified by:
setPropertyValuesin interfaceEntityPersister
-
setPropertyValue
public void setPropertyValue(Object object, int i, Object value)
Description copied from interface:EntityPersisterSet the value of a particular property of the given instance.- Specified by:
setPropertyValuein interfaceEntityPersister
-
getPropertyValues
public Object[] getPropertyValues(Object object)
Description copied from interface:ClassMetadataExtract the property values from the given entity.- Specified by:
getPropertyValuesin interfaceClassMetadata- Specified by:
getPropertyValuesin interfaceEntityPersister- Parameters:
object- The entity from which to extract the property values.- Returns:
- The property values.
-
getPropertyValue
public Object getPropertyValue(Object object, int i)
- Specified by:
getPropertyValuein interfaceEntityPersister
-
getPropertyValue
public Object getPropertyValue(Object object, String propertyName)
Description copied from interface:EntityPersisterGet the value of a particular property- Specified by:
getPropertyValuein interfaceClassMetadata- Specified by:
getPropertyValuein interfaceEntityPersister
-
getIdentifier
public Object getIdentifier(Object entity, SharedSessionContractImplementor session)
Description copied from interface:EntityPersisterGet the identifier of an instance from the object's identifier property. Throw an exception if it has no identifier property.- Specified by:
getIdentifierin interfaceClassMetadata- Specified by:
getIdentifierin interfaceEntityPersister- Parameters:
entity- The entity for which to get the identifiersession- The session from which the request originated- Returns:
- The identifier
-
setIdentifier
public void setIdentifier(Object entity, Object id, SharedSessionContractImplementor session)
Description copied from interface:EntityPersisterInject the identifier value into the given entity.- Specified by:
setIdentifierin interfaceClassMetadata- Specified by:
setIdentifierin interfaceEntityPersister- Parameters:
entity- The entity to inject with the identifier value.id- The value to be injected as the identifier.session- The session from which is requests originates
-
getVersion
public Object getVersion(Object object)
Description copied from interface:EntityPersisterGet the version number (or timestamp) from the object's version property. Returnnullif it is not versioned.- Specified by:
getVersionin interfaceClassMetadata- Specified by:
getVersionin interfaceEntityPersister
-
instantiate
public Object instantiate(Object id, SharedSessionContractImplementor session)
Description copied from interface:EntityPersisterCreate a class instance initialized with the given identifier- Specified by:
instantiatein interfaceClassMetadata- Specified by:
instantiatein interfaceEntityPersister- Parameters:
id- The identifier value to use (may be null to represent no value)session- The session from which the request originated.- Returns:
- The instantiated entity.
-
linkToSession
protected void linkToSession(Object entity, SharedSessionContractImplementor session)
-
isInstance
public boolean isInstance(Object object)
Description copied from interface:EntityPersisterIs the given object an instance of this entity?- Specified by:
isInstancein interfaceEntityPersister
-
hasUninitializedLazyProperties
public boolean hasUninitializedLazyProperties(Object object)
Description copied from interface:EntityPersisterDoes the given instance have any uninitialized lazy properties?- Specified by:
hasUninitializedLazyPropertiesin interfaceEntityPersister
-
resetIdentifier
public void resetIdentifier(Object entity, Object currentId, Object currentVersion, SharedSessionContractImplementor session)
Description copied from interface:EntityPersisterSet the identifier and version of the given instance back to its "unsaved" value, that is, the value it had before it was made persistent.- Specified by:
resetIdentifierin interfaceEntityPersister
-
getSubclassEntityPersister
public EntityPersister getSubclassEntityPersister(Object instance, SessionFactoryImplementor factory)
Description copied from interface:EntityPersisterObtain theEntityPersisterfor the concrete class of the given entity instance which participates in a mapped inheritance hierarchy with this persister. The given instance must be an instance of a subclass of the persistent class managed by this persister.A request has already identified the entity name of this persister as the mapping for the given instance. However, we still need to account for possible subclassing and potentially reroute to the more appropriate persister.
For example, a request names
Animalas the entity name which gets resolved to this persister. But the actual instance is really an instance ofCatwhich is a subclass ofAnimal. So, here theAnimalpersister is being asked to return the persister specific toCat.It's also possible that the instance is actually an
Animalinstance in the above example in which case we would returnthisfrom this method.- Specified by:
getSubclassEntityPersisterin interfaceEntityPersister- Parameters:
instance- The entity instancefactory- Reference to the SessionFactory- Returns:
- The appropriate persister
-
isMultiTable
@Deprecated(since="6.0") public boolean isMultiTable()
Deprecated.Description copied from interface:QueryableIs the inheritance hierarchy described by this persister contained across multiple tables?- Specified by:
isMultiTablein interfaceQueryable- Returns:
- True if the inheritance hierarchy is spread across multiple tables; false otherwise.
-
hasMultipleTables
protected boolean hasMultipleTables()
-
getPropertySpan
public int getPropertySpan()
-
getPropertyValuesToInsert
public Object[] getPropertyValuesToInsert(Object entity, Map<Object,Object> mergeMap, SharedSessionContractImplementor session) throws HibernateException
Description copied from interface:EntityPersisterReturn the values of the insertable properties of the object (including backrefs)- Specified by:
getPropertyValuesToInsertin interfaceClassMetadata- Specified by:
getPropertyValuesToInsertin interfaceEntityPersister- Throws:
HibernateException
-
shouldGetAllProperties
protected boolean shouldGetAllProperties(Object entity)
-
processInsertGeneratedProperties
public void processInsertGeneratedProperties(Object id, Object entity, Object[] state, SharedSessionContractImplementor session)
Description copied from interface:EntityPersisterPerform a select to retrieve the values of any generated properties back from the database, injecting these generated values into the given entity as well as writing this state to thePersistenceContext.Note, that because we update the PersistenceContext here, callers need to take care that they have already written the initial snapshot to the PersistenceContext before calling this method.
- Specified by:
processInsertGeneratedPropertiesin interfaceEntityPersister
-
processUpdateGeneratedProperties
public void processUpdateGeneratedProperties(Object id, Object entity, Object[] state, SharedSessionContractImplementor session)
Description copied from interface:EntityPersisterPerform a select to retrieve the values of any generated properties back from the database, injecting these generated values into the given entity as well as writing this state to thePersistenceContext.Note, that because we update the PersistenceContext here, callers need to take care that they have already written the initial snapshot to the PersistenceContext before calling this method.
- Specified by:
processUpdateGeneratedPropertiesin interfaceEntityPersister
-
getIdentifierPropertyName
public String getIdentifierPropertyName()
Description copied from interface:EntityPersisterGet the name of the identifier property (or return null) - need not return the name of an actual Java property- Specified by:
getIdentifierPropertyNamein interfaceClassMetadata- Specified by:
getIdentifierPropertyNamein interfaceEntityPersister
-
getIdentifierType
public Type getIdentifierType()
Description copied from interface:EntityPersisterGet the identifier type- Specified by:
getIdentifierTypein interfaceClassMetadata- Specified by:
getIdentifierTypein interfaceEntityPersister
-
hasSubselectLoadableCollections
public boolean hasSubselectLoadableCollections()
Description copied from interface:EntityPersisterDetermine whether this entity contains references to persistent collections which are fetchable by subselect?- Specified by:
hasSubselectLoadableCollectionsin interfaceEntityPersister- Returns:
- True if the entity contains collections fetchable by subselect; false otherwise.
-
getNaturalIdentifierProperties
public int[] getNaturalIdentifierProperties()
Description copied from interface:EntityPersisterIf the entity defines a natural id, that is, ifEntityPersister.hasNaturalIdentifier()returnstrue, the indices of the properties which make up the natural id.- Specified by:
getNaturalIdentifierPropertiesin interfaceClassMetadata- Specified by:
getNaturalIdentifierPropertiesin interfaceEntityPersister- Returns:
- The indices of the properties making up the natural id; or null, if no natural id is defined.
-
getNaturalIdentifierSnapshot
public Object getNaturalIdentifierSnapshot(Object id, SharedSessionContractImplementor session)
Description copied from interface:EntityPersisterRetrieve the current state of the natural-id properties from the database.- Specified by:
getNaturalIdentifierSnapshotin interfaceEntityPersister- Parameters:
id- The identifier of the entity for which to retrieve the natural-id values.session- The session from which the request originated.- Returns:
- The natural-id snapshot.
-
getNaturalIdLoader
public NaturalIdLoader<?> getNaturalIdLoader()
Description copied from interface:EntityMappingTypeAccess to performing natural-id database selection. This is per-entity in the hierarchy- Specified by:
getNaturalIdLoaderin interfaceEntityMappingType- Specified by:
getNaturalIdLoaderin interfaceEntityPersister
-
getMultiNaturalIdLoader
public MultiNaturalIdLoader<?> getMultiNaturalIdLoader()
Description copied from interface:EntityMappingTypeAccess to performing multi-value natural-id database selection. This is per-entity in the hierarchy- Specified by:
getMultiNaturalIdLoaderin interfaceEntityMappingType- Specified by:
getMultiNaturalIdLoaderin interfaceEntityPersister
-
loadEntityIdByNaturalId
public Object loadEntityIdByNaturalId(Object[] naturalIdValues, LockOptions lockOptions, SharedSessionContractImplementor session)
Description copied from interface:EntityPersisterLoad the id for the entity based on the natural id.- Specified by:
loadEntityIdByNaturalIdin interfaceEntityPersister
-
hasNaturalIdentifier
public boolean hasNaturalIdentifier()
Description copied from interface:EntityPersisterDetermine whether this entity defines a natural identifier.- Specified by:
hasNaturalIdentifierin interfaceClassMetadata- Specified by:
hasNaturalIdentifierin interfaceEntityPersister- Returns:
- True if the entity defines a natural id; false otherwise.
-
setPropertyValue
public void setPropertyValue(Object object, String propertyName, Object value)
Description copied from interface:ClassMetadataSet the value of a particular (named) property- Specified by:
setPropertyValuein interfaceClassMetadata
-
getRepresentationStrategy
public EntityRepresentationStrategy getRepresentationStrategy()
Description copied from interface:EntityMappingTypeDescribes how the entity is represented in the application's domain model.- Specified by:
getRepresentationStrategyin interfaceEntityMappingType- Specified by:
getRepresentationStrategyin interfaceEntityPersister
-
getInstrumentationMetadata
public BytecodeEnhancementMetadata getInstrumentationMetadata()
- Specified by:
getInstrumentationMetadatain interfaceEntityPersister
-
getBytecodeEnhancementMetadata
public BytecodeEnhancementMetadata getBytecodeEnhancementMetadata()
- Specified by:
getBytecodeEnhancementMetadatain interfaceEntityPersister
-
getTableAliasForColumn
public String getTableAliasForColumn(String columnName, String rootAlias)
Description copied from interface:LoadableGiven a column name and the root table alias in use for the entity hierarchy, determine the proper table alias for the table in that hierarchy that contains said column.NOTE : Generally speaking the column is not validated to exist. Most implementations simply return the root alias; the exception is
JoinedSubclassEntityPersister- Specified by:
getTableAliasForColumnin interfaceLoadable- Parameters:
columnName- The column namerootAlias- The hierarchy root alias- Returns:
- The proper table alias for qualifying the given column.
-
determineTableNumberForColumn
public int determineTableNumberForColumn(String columnName)
-
getEntityEntryFactory
public EntityEntryFactory getEntityEntryFactory()
Description copied from interface:EntityPersisterGet the EntityEntryFactory indicated for the entity mapped by this persister.- Specified by:
getEntityEntryFactoryin interfaceEntityPersister- Returns:
- The proper EntityEntryFactory.
-
forEachAttributeMapping
public void forEachAttributeMapping(Consumer<? super AttributeMapping> action)
Description copied from interface:EntityMappingTypeVisit each attribute mapping- Specified by:
forEachAttributeMappingin interfaceEntityMappingType- Specified by:
forEachAttributeMappingin interfaceManagedMappingType- See Also:
EntityMappingType.getAttributeMappings()
-
forEachAttributeMapping
public void forEachAttributeMapping(IndexedConsumer<? super AttributeMapping> consumer)
Description copied from interface:ManagedMappingTypeVisit attributes defined on this class and any supers- Specified by:
forEachAttributeMappingin interfaceManagedMappingType
-
prepareMappingModel
public void prepareMappingModel(MappingModelCreationProcess creationProcess)
Description copied from interface:InFlightEntityMappingTypeAfter all hierarchy types have been linked, this method is called to allow the mapping model to be prepared which generally includes creating attribute mapping descriptors, identifier mapping descriptor, etc.- Specified by:
prepareMappingModelin interfaceInFlightEntityMappingType
-
interpretSqmMultiTableStrategy
protected static SqmMultiTableMutationStrategy interpretSqmMultiTableStrategy(AbstractEntityPersister entityMappingDescriptor, MappingModelCreationProcess creationProcess)
-
interpretSqmMultiTableInsertStrategy
protected static SqmMultiTableInsertStrategy interpretSqmMultiTableInsertStrategy(AbstractEntityPersister entityMappingDescriptor, MappingModelCreationProcess creationProcess)
-
getSqmMultiTableMutationStrategy
public SqmMultiTableMutationStrategy getSqmMultiTableMutationStrategy()
Description copied from interface:EntityPersisterThe strategy to use for SQM mutation statements where the target entity has multiple tables. Returnsnullto indicate that the entity does not have multiple tables.- Specified by:
getSqmMultiTableMutationStrategyin interfaceEntityMappingType- Specified by:
getSqmMultiTableMutationStrategyin interfaceEntityPersister
-
getSqmMultiTableInsertStrategy
public SqmMultiTableInsertStrategy getSqmMultiTableInsertStrategy()
- Specified by:
getSqmMultiTableInsertStrategyin interfaceEntityMappingType- Specified by:
getSqmMultiTableInsertStrategyin interfaceEntityPersister
-
getStateArrayInitialPosition
protected int getStateArrayInitialPosition(MappingModelCreationProcess creationProcess)
-
isPhysicalDiscriminator
protected boolean isPhysicalDiscriminator()
-
generateDiscriminatorMapping
protected EntityDiscriminatorMapping generateDiscriminatorMapping(PersistentClass bootEntityDescriptor, MappingModelCreationProcess modelCreationProcess)
-
buildDiscriminatorValueMappings
protected abstract Map<Object,EntityDiscriminatorMapping.DiscriminatorValueDetails> buildDiscriminatorValueMappings(PersistentClass bootEntityDescriptor, MappingModelCreationProcess modelCreationProcess)
-
generateVersionMapping
protected EntityVersionMapping generateVersionMapping(Supplier<?> templateInstanceCreator, PersistentClass bootEntityDescriptor, MappingModelCreationProcess creationProcess)
-
shouldProcessSuperMapping
protected boolean shouldProcessSuperMapping()
-
linkWithSuperType
public void linkWithSuperType(MappingModelCreationProcess creationProcess)
Description copied from interface:InFlightEntityMappingTypeLink an entity type with its super-type, if one.- Specified by:
linkWithSuperTypein interfaceInFlightEntityMappingType
-
linkWithSubType
public void linkWithSubType(EntityMappingType sub, MappingModelCreationProcess creationProcess)
Description copied from interface:InFlightEntityMappingTypeCalled fromInFlightEntityMappingType.linkWithSuperType(org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess). A callback from the entity-type to the super-type it resolved.- Specified by:
linkWithSubTypein interfaceInFlightEntityMappingType
-
getNumberOfAttributeMappings
public int getNumberOfAttributeMappings()
Description copied from interface:EntityMappingTypeThe total number of attributes for this entity, including those declared on supertype mappings- Specified by:
getNumberOfAttributeMappingsin interfaceEntityMappingType- Specified by:
getNumberOfAttributeMappingsin interfaceManagedMappingType
-
getAttributeMapping
public AttributeMapping getAttributeMapping(int position)
Description copied from interface:EntityMappingTypeRetrieve an attribute mapping by position, relative to all attributes- Specified by:
getAttributeMappingin interfaceEntityMappingType- Specified by:
getAttributeMappingin interfaceEntityPersister- Specified by:
getAttributeMappingin interfaceManagedMappingType
-
getNumberOfDeclaredAttributeMappings
public int getNumberOfDeclaredAttributeMappings()
Description copied from interface:EntityMappingTypeGet the number of attributes defined on this entity mapping - do not access attributes defined on the super- Specified by:
getNumberOfDeclaredAttributeMappingsin interfaceEntityMappingType
-
getDeclaredAttributeMappings
public AttributeMappingsMap getDeclaredAttributeMappings()
Description copied from interface:EntityMappingTypeGet access to the attributes defined on this class - do not access attributes defined on the super- Specified by:
getDeclaredAttributeMappingsin interfaceEntityMappingType
-
visitDeclaredAttributeMappings
public void visitDeclaredAttributeMappings(Consumer<? super AttributeMapping> action)
Description copied from interface:EntityMappingTypeVisit attributes defined on this class - do not visit attributes defined on the super- Specified by:
visitDeclaredAttributeMappingsin interfaceEntityMappingType
-
getSuperMappingType
public EntityMappingType getSuperMappingType()
Description copied from interface:EntityMappingTypeThe mapping for the entity which is the supertype for this entity mapping.- Specified by:
getSuperMappingTypein interfaceEntityMappingType- Returns:
- The supertype mapping, or
nullif there is no supertype
-
getSubMappingTypes
public Collection<EntityMappingType> getSubMappingTypes()
Description copied from interface:EntityMappingTypeRetrieve mappings for all subtypes- Specified by:
getSubMappingTypesin interfaceEntityMappingType
-
isTypeOrSuperType
public boolean isTypeOrSuperType(EntityMappingType targetType)
Description copied from interface:EntityMappingTypeWhether the passed entity mapping is the same as or is a supertype of this entity mapping- Specified by:
isTypeOrSuperTypein interfaceEntityMappingType
-
generateIdentifierMapping
protected EntityIdentifierMapping generateIdentifierMapping(Supplier<?> templateInstanceCreator, PersistentClass bootEntityDescriptor, MappingModelCreationProcess creationProcess)
-
generateNonEncapsulatedCompositeIdentifierMapping
protected EntityIdentifierMapping generateNonEncapsulatedCompositeIdentifierMapping(MappingModelCreationProcess creationProcess, PersistentClass bootEntityDescriptor)
-
generateVersionMapping
protected static EntityVersionMapping generateVersionMapping(AbstractEntityPersister entityPersister, Supplier<?> templateInstanceCreator, PersistentClass bootModelRootEntityDescriptor, MappingModelCreationProcess creationProcess)
- Parameters:
entityPersister- The AbstractEntityPersister being constructed - still initializingbootModelRootEntityDescriptor- The boot-time entity descriptor for the "root entity" in the hierarchycreationProcess- The SF creation process - access to useful things
-
getMappedJavaType
public JavaType<?> getMappedJavaType()
Description copied from interface:MappingTypeThe descriptor descriptor for the mapped Java type- Specified by:
getMappedJavaTypein interfaceEntityMappingType- Specified by:
getMappedJavaTypein interfaceMappingType
-
getEntityPersister
public EntityPersister getEntityPersister()
Description copied from interface:EntityMappingTypeSafety-net.- Specified by:
getEntityPersisterin interfaceEntityMappingType
-
getIdentifierMapping
public EntityIdentifierMapping getIdentifierMapping()
Description copied from interface:EntityMappingTypeMapping details for the entity's identifier. This is shared across all entity mappings within an inheritance hierarchy.- Specified by:
getIdentifierMappingin interfaceEntityMappingType
-
getVersionMapping
public EntityVersionMapping getVersionMapping()
Description copied from interface:EntityMappingTypeMapping details for the entity's version when using the version strategy. This is shared across all entity mappings within an inheritance hierarchy.- Specified by:
getVersionMappingin interfaceEntityMappingType- Returns:
- The version mapping, or null if the entity is (1) defined
with a strategy other than
OptimisticLockStyle.VERSIONor (2) defined without optimistic locking - See Also:
EntityMappingType.optimisticLockStyle()
-
getRowIdMapping
public EntityRowIdMapping getRowIdMapping()
Description copied from interface:EntityMappingTypeThe mapping for the row-id of the entity, if one is defined.- Specified by:
getRowIdMappingin interfaceEntityMappingType
-
getDiscriminatorMapping
public EntityDiscriminatorMapping getDiscriminatorMapping()
Description copied from interface:EntityMappingTypeMapping details for the entity's discriminator. This is shared across all entity mappings within an inheritance hierarchy.- Specified by:
getDiscriminatorMappingin interfaceEntityMappingType
-
getAttributeMappings
public AttributeMappingsList getAttributeMappings()
Description copied from interface:EntityMappingTypeThe attributes mapping for this entity, including those declared on supertype mappings- Specified by:
getAttributeMappingsin interfaceEntityMappingType- Specified by:
getAttributeMappingsin interfaceManagedMappingType
-
findDeclaredAttributeMapping
public AttributeMapping findDeclaredAttributeMapping(String name)
Description copied from interface:EntityMappingTypeFind an attribute-mapping, declared on this entity mapping (not super or subs), by name- Specified by:
findDeclaredAttributeMappingin interfaceEntityMappingType
-
findAttributeMapping
public AttributeMapping findAttributeMapping(String name)
Description copied from interface:ManagedMappingTypeFind an attribute by name.- Specified by:
findAttributeMappingin interfaceManagedMappingType- Returns:
- The named attribute, or
nullif no match was found
-
findSubPart
public ModelPart findSubPart(String name, EntityMappingType treatTargetType)
- Specified by:
findSubPartin interfaceEntityValuedModelPart- Specified by:
findSubPartin interfaceModelPartContainer
-
findSubTypesSubPart
public ModelPart findSubTypesSubPart(String name, EntityMappingType treatTargetType)
- Specified by:
findSubTypesSubPartin interfaceEntityMappingType
-
visitSubParts
public void visitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType)
- Specified by:
visitSubPartsin interfaceEntityValuedModelPart- Specified by:
visitSubPartsin interfaceModelPartContainer
-
visitKeyFetchables
public void visitKeyFetchables(Consumer<? super Fetchable> fetchableConsumer, EntityMappingType treatTargetType)
- Specified by:
visitKeyFetchablesin interfaceFetchableContainer
-
visitKeyFetchables
public void visitKeyFetchables(IndexedConsumer<? super Fetchable> fetchableConsumer, EntityMappingType treatTargetType)
- Specified by:
visitKeyFetchablesin interfaceFetchableContainer
-
getNumberOfFetchables
public int getNumberOfFetchables()
Description copied from interface:FetchableContainerThe number of fetchables in the container- Specified by:
getNumberOfFetchablesin interfaceEntityMappingType- Specified by:
getNumberOfFetchablesin interfaceFetchableContainer
-
getNumberOfFetchableKeys
public int getNumberOfFetchableKeys()
Description copied from interface:FetchableContainerThe number of fetchables in the container- Specified by:
getNumberOfFetchableKeysin interfaceFetchableContainer
-
getNumberOfKeyFetchables
public int getNumberOfKeyFetchables()
Description copied from interface:FetchableContainerThe number of key fetchables in the container- Specified by:
getNumberOfKeyFetchablesin interfaceFetchableContainer
-
getKeyFetchable
public Fetchable getKeyFetchable(int position)
- Specified by:
getKeyFetchablein interfaceFetchableContainer
-
getFetchable
public Fetchable getFetchable(int position)
- Specified by:
getFetchablein interfaceEntityMappingType- Specified by:
getFetchablein interfaceFetchableContainer
-
visitFetchables
public void visitFetchables(Consumer<? super Fetchable> fetchableConsumer, EntityMappingType treatTargetType)
- Specified by:
visitFetchablesin interfaceFetchableContainer
-
visitFetchables
public void visitFetchables(IndexedConsumer<? super Fetchable> fetchableConsumer, EntityMappingType treatTargetType)
- Specified by:
visitFetchablesin interfaceFetchableContainer
-
getStaticFetchableList
protected AttributeMappingsList getStaticFetchableList()
-
visitAttributeMappings
public void visitAttributeMappings(Consumer<? super AttributeMapping> action, EntityMappingType targetType)
Description copied from interface:EntityMappingTypeVisit the mappings, but limited to just attributes defined in the targetType or its super-type(s) if any.- Specified by:
visitAttributeMappingsin interfaceEntityMappingType
-
visitSuperTypeAttributeMappings
public void visitSuperTypeAttributeMappings(Consumer<? super AttributeMapping> action)
Description copied from interface:EntityMappingTypeWalk this type's attributes as well as its super-type's- Specified by:
visitSuperTypeAttributeMappingsin interfaceEntityMappingType
-
forEachSelectable
public int forEachSelectable(int offset, SelectableConsumer selectableConsumer)- Specified by:
forEachSelectablein interfaceModelPart
-
visitSubTypeAttributeMappings
public void visitSubTypeAttributeMappings(Consumer<? super AttributeMapping> action)
Description copied from interface:EntityMappingTypeWalk this type's attributes as well as its sub-type's- Specified by:
visitSubTypeAttributeMappingsin interfaceEntityMappingType
-
getJdbcTypeCount
public int getJdbcTypeCount()
Description copied from interface:BindableThe number of JDBC mappings- Specified by:
getJdbcTypeCountin interfaceBindable- Specified by:
getJdbcTypeCountin interfaceEntityMappingType- Specified by:
getJdbcTypeCountin interfaceEntityValuedModelPart- Specified by:
getJdbcTypeCountin interfaceJdbcMappingContainer
-
forEachJdbcType
public int forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)Description copied from interface:JdbcMappingContainerVisit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcTypein interfaceEntityValuedModelPart- Specified by:
forEachJdbcTypein interfaceJdbcMappingContainer
-
disassemble
public Object disassemble(Object value, SharedSessionContractImplementor session)
- Specified by:
disassemblein interfaceBindable- Specified by:
disassemblein interfaceEntityValuedModelPart- See Also:
As an example, consider the following domain model: ````
-
forEachDisassembledJdbcValue
public int forEachDisassembledJdbcValue(Object value, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)
- Specified by:
forEachDisassembledJdbcValuein interfaceBindable- Specified by:
forEachDisassembledJdbcValuein interfaceEntityValuedModelPart
-
forEachJdbcValue
public int forEachJdbcValue(Object value, int offset, Bindable.JdbcValuesConsumer consumer, SharedSessionContractImplementor session)
- Specified by:
forEachJdbcValuein interfaceBindable- Specified by:
forEachJdbcValuein interfaceEntityValuedModelPart
-
hasPartitionedSelectionMapping
public boolean hasPartitionedSelectionMapping()
- Specified by:
hasPartitionedSelectionMappingin interfaceManagedMappingType- Specified by:
hasPartitionedSelectionMappingin interfaceModelPart
-
isInsertCallable
@Deprecated(since="6", forRemoval=true) public boolean isInsertCallable(int j)
Deprecated, for removal: This API element is subject to removal in a future version.With no replacement
-
isUpdateCallable
@Deprecated(since="6", forRemoval=true) public boolean isUpdateCallable(int j)
Deprecated, for removal: This API element is subject to removal in a future version.With no replacement
-
isDeleteCallable
@Deprecated(since="6", forRemoval=true) public boolean isDeleteCallable(int j)
Deprecated, for removal: This API element is subject to removal in a future version.With no replacement
-
isSubclassTableSequentialSelect
@Deprecated(since="6", forRemoval=true) protected boolean isSubclassTableSequentialSelect(int j)
Deprecated, for removal: This API element is subject to removal in a future version.With no replacement
-
getElementTypeDescriptor
@Deprecated(since="6", forRemoval=true) public EntityMappingType getElementTypeDescriptor()
Deprecated, for removal: This API element is subject to removal in a future version.With no replacement.
-
isTableCascadeDeleteEnabled
@Deprecated(forRemoval=true) public abstract @org.hibernate.Remove boolean isTableCascadeDeleteEnabled(int j)
Deprecated, for removal: This API element is subject to removal in a future version.No longer used
-
isInverseSubclassTable
@Deprecated(forRemoval=true) protected @org.hibernate.Remove boolean isInverseSubclassTable(int j)
Deprecated, for removal: This API element is subject to removal in a future version.No longer used
-
getSQLDeleteStrings
@Deprecated(forRemoval=true) public String[] getSQLDeleteStrings()
Deprecated, for removal: This API element is subject to removal in a future version.No longer used. SeegetDeleteCoordinator()
-
getSQLUpdateStrings
@Deprecated(forRemoval=true) public String[] getSQLUpdateStrings()
Deprecated, for removal: This API element is subject to removal in a future version.No longer used. SeegetUpdateCoordinator()
-
getTableUpdateNeeded
@Deprecated(forRemoval=true) public @org.hibernate.Remove boolean[] getTableUpdateNeeded(int[] dirtyProperties, boolean hasDirtyCollection)
Deprecated, for removal: This API element is subject to removal in a future version.No longer used. SeeUpdateCoordinatorDecide which tables need to be updated.The return here is an array of boolean values with each index corresponding to a given table in the scope of this persister.
- Parameters:
dirtyProperties- The indices of all the entity properties considered dirty.hasDirtyCollection- Whether any collections owned by the entity which were considered dirty.- Returns:
- Array of booleans indicating which table require updating.
-
isBatchable
@Deprecated(forRemoval=true) public @org.hibernate.Remove boolean isBatchable()
Deprecated, for removal: This API element is subject to removal in a future version.No longer used. SeeMutationExecutorService
-
generateDeleteString
@Deprecated(forRemoval=true) public String generateDeleteString(int j)
Deprecated, for removal: This API element is subject to removal in a future version.No longer used. SeeDeleteCoordinatorGenerate the SQL that deletes a row by id (and version)
-
dehydrate
@Deprecated(forRemoval=true) public @org.hibernate.Remove int dehydrate(Object id, Object[] fields, Object rowId, boolean[] includeProperty, boolean[][] includeColumns, int j, PreparedStatement ps, SharedSessionContractImplementor session, int index, boolean isUpdate) throws SQLException, HibernateException
Deprecated, for removal: This API element is subject to removal in a future version.No longer used.Marshall the fields of a persistent instance to a prepared statement- Throws:
SQLExceptionHibernateException
-
generateSQLDeleteStrings
@Deprecated(since="6.2", forRemoval=true) protected String[] generateSQLDeleteStrings(Object[] loadedState)
Deprecated, for removal: This API element is subject to removal in a future version.
-
isAllNull
@Deprecated(since="6.2", forRemoval=true) public final @org.hibernate.Remove boolean isAllNull(Object[] array, int tableNumber)
Deprecated, for removal: This API element is subject to removal in a future version.
-
-