Class AbstractEntityPersister
- All Implemented Interfaces:
LazyPropertyInitializer,FetchProfileAffectee,Loadable,Bindable,Discriminable,EntityMappingType,EntityValuedModelPart,FilterRestrictable,InFlightEntityMappingType,JdbcMappingContainer,ManagedMappingType,MappingModelExpressible,MappingType,ModelPart,ModelPartContainer,Restrictable,SoftDeletableModelPart,WhereRestrictable,EntityPersister,Joinable,EntityMutationTarget,AttributeSource,RootTableGroupProducer,TableGroupProducer,MutationTarget<EntityTableMapping>,FetchableContainer
- Direct Known Subclasses:
JoinedSubclassEntityPersister,SingleTableEntityPersister,UnionSubclassEntityPersister
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceConsolidated these onto a single helper because the 2 pieces work in tandem.protected static interfaceConsumer for processing table details.Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.Bindable
Bindable.JdbcValuesBiConsumer<X,Y>, Bindable.JdbcValuesConsumer Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.EntityMappingType
EntityMappingType.ConstraintOrderedTableConsumerNested classes/interfaces inherited from interface org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer
LazyPropertyInitializer.InterceptorImplementorNested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.JdbcValueBiConsumer<X,Y>, ModelPart.JdbcValueConsumer -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ReflectionOptimizer.AccessOptimizerprotected final intprotected String[]Deprecated.protected String[]Deprecated.protected String[]Deprecated.protected AttributeMappingsMapprotected boolean[]Deprecated.protected Expectation[]Deprecated.static final Stringprotected final String[]protected boolean[]Deprecated.protected Expectation[]Deprecated.static final Stringprotected final Stringprotected AttributeMappingsListprotected boolean[]Deprecated.protected Expectation[]Deprecated.static final StringFields inherited from interface org.hibernate.persister.entity.EntityPersister
ENTITY_IDFields inherited from interface org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer
UNFETCHED_PROPERTY -
Constructor Summary
ConstructorsConstructorDescriptionAbstractEntityPersister(PersistentClass persistentClass, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy, RuntimeModelCreationContext creationContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDiscriminatorToInsertGroup(MutationGroupBuilder insertGroupBuilder) voidaddSoftDeleteToInsertGroup(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, boolean onlyApplyLoadByKeyFilters, 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, boolean onlyApplyLoadByKeyFilters, 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 theSQLRestrictionrestrictionsbuildCacheEntry(Object entity, Object[] state, Object version, SharedSessionContractImplementor session) protected AbstractEntityPersister.CacheEntryHelperprotected DeleteCoordinatorprotected EmbeddedAttributeMappingbuildEmbeddedAttributeMapping(String attrName, int stateArrayPosition, int fetchableIndex, Property bootProperty, DependantValue dependantValue, int dependantColumnIndex, ManagedMappingType declaringType, CompositeType attrType, String tableExpression, String[] rootTableKeyColumnNames, PropertyAccess propertyAccess, CascadeStyle cascadeStyle, MappingModelCreationProcess creationProcess) For Hibernate Reactiveprotected InsertCoordinatorprotected UpdateCoordinatorprotected MultiIdEntityLoader<?> Used by Hibernate Reactiveprotected AttributeMappingbuildPluralAttributeMapping(String attrName, int stateArrayPosition, int fetchableIndex, Property bootProperty, ManagedMappingType declaringType, PropertyAccess propertyAccess, CascadeStyle cascadeStyle, FetchMode fetchMode, MappingModelCreationProcess creationProcess) For Hibernate Reactiveprotected SingleIdEntityLoader<?> For Hibernate Reactiveprotected AttributeMappingbuildSingularAssociationAttributeMapping(String attrName, NavigableRole navigableRole, int stateArrayPosition, int fetchableIndex, Property bootProperty, ManagedMappingType declaringType, EntityPersister declaringEntityPersister, EntityType attrType, PropertyAccess propertyAccess, CascadeStyle cascadeStyle, MappingModelCreationProcess creationProcess) For Hibernate Reactiveprotected EntityTableMapping[]Builds the EntityTableMapping descriptors for the tables mapped by this entity.protected UpdateCoordinatorbooleanbooleanbooleanbooleancontainsTableReference(String tableExpression) int<T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState) Create a DomainResult for a specific reference to this ModelPart.protected GeneratedValuesProcessorcreateGeneratedValuesProcessor(EventType timing, List<AttributeMapping> generatedAttributes) protected GeneratedValuesMutationDelegatecreatePrimaryTableReference(SqlAliasBase sqlAliasBase, SqlAstCreationState sqlAstCreationState) createProxy(Object id, SharedSessionContractImplementor session) Create a new proxy instancecreateRootTableGroup(boolean canUseInnerJoins, NavigablePath navigablePath, String explicitSourceAlias, SqlAliasBase explicitSqlAliasBase, Supplier<Consumer<Predicate>> additionalPredicateCollectorAccess, SqlAstCreationState creationState) Create a root TableGroup as defined by this producercreateTableReferenceJoin(String joinTableExpression, SqlAliasBase sqlAliasBase, TableReference lhs, SqlAstCreationState creationState) protected GeneratedValuesMutationDelegateprotected SingleIdEntityLoader<?> determineLoaderToUse(SharedSessionContractImplementor session, LockOptions lockOptions) protected StringdetermineTableName(Table table) protected intdetermineTableNumberForColumn(String columnName) disassemble(Object value, SharedSessionContractImplementor session) Breaks down a value ofJinto its simple pieces.findAttributeMapping(String name) Find an attribute by 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.findSubPart(String name, EntityMappingType treatTargetType) findSubTypesSubPart(String name, EntityMappingType treatTargetType) forceVersionIncrement(Object id, Object currentVersion, boolean batching, SharedSessionContractImplementor session) forceVersionIncrement(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 supers<X,Y> int forEachDisassembledJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X, Y> valuesConsumer, SharedSessionContractImplementor session) LikeBindable.forEachDisassembledJdbcValue(Object, Object, Object, JdbcValuesBiConsumer, SharedSessionContractImplementor), but additionally receives an offset by which the selectionIndex is incremented when callingBindable.JdbcValuesBiConsumer.consume(int, Object, Object, Object, JdbcMapping).intforEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action) Visit each JdbcMapping starting from the given offset<X,Y> int forEachJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X, Y> consumer, SharedSessionContractImplementor session) Visit each constituent JDBC value extracted from the entity instance itself.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) Visits each selectable mapping with the selectable index offset by the given value.protected EntityDiscriminatorMappinggenerateDiscriminatorMapping(PersistentClass bootEntityDescriptor) protected EntityIdentifierMappinggenerateIdentifierMapping(Supplier<?> templateInstanceCreator, PersistentClass bootEntityDescriptor, MappingModelCreationProcess creationProcess) protected PredicategenerateJoinPredicate(TableReference rootTableReference, TableReference joinedTableReference, String[] pkColumnNames, String[] fkColumnNames, SqlAstCreationState creationState) protected LockingStrategygenerateLocker(LockMode lockMode, Locking.Scope lockScope) protected NaturalIdMappinggenerateNaturalIdMapping(MappingModelCreationProcess creationProcess, PersistentClass bootEntityDescriptor) protected EntityIdentifierMappinggenerateNonEncapsulatedCompositeIdentifierMapping(MappingModelCreationProcess creationProcess, PersistentClass bootEntityDescriptor) protected AttributeMappinggenerateNonIdAttributeMapping(NonIdentifierAttribute tupleAttrDefinition, Property bootProperty, int stateArrayPosition, int fetchableIndex, MappingModelCreationProcess creationProcess) Generate the SQL that selects the version number by idstatic StringgenerateTableAlias(String rootAlias, int tableNumber) protected TableReferenceJoingenerateTableReferenceJoin(TableReference lhs, String joinTableExpression, SqlAliasBase sqlAliasBase, boolean innerJoin, String[] targetColumns, SqlAstCreationState creationState) protected EntityVersionMappinggenerateVersionMapping(Supplier<?> templateInstanceCreator, PersistentClass bootEntityDescriptor, MappingModelCreationProcess creationProcess) protected static EntityVersionMappinggenerateVersionMapping(AbstractEntityPersister entityPersister, Supplier<?> templateInstanceCreator, PersistentClass bootModelRootEntityDescriptor, MappingModelCreationProcess creationProcess) getAttributeMapping(int position) Retrieve an attribute mapping by position, relative to all attributesThe attributes mapping for this entity, including those declared on supertype mappingsintThe batch size for batch loading.Get the cache (optional operation)Get the cache structurestatic @Nullable ObjectgetCollectionKey(CollectionPersister persister, Object owner, EntityEntry ownerEntry, SharedSessionContractImplementor session) Class<?> Get the proxy interface that instances of this concrete class will be cast to (optional operation).abstract String[]getCurrentVersion(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.Get access to the attributes defined on this class - do not access attributes defined on the superGet the delete coordinator instance.getDiscriminatorAlias(String suffix) Get the result set aliases used for the identifier columns, given a suffixThe type of the discriminator, ornullif the entity does not have a discriminator.Mapping details for the entity's discriminator.abstract BasicType<?> Get the discriminator typeGet theEntityEntryFactoryindicated for the entity mapped by this persister.Retrieve the underlying entity metamodel instance.final StringThe entity name which this persister maps.getEntityNameByTableNameMap(PersistentClass persistentClass, SqlStringGenerationContext stringGenerationContext) Safety-net.Return theSessionFactoryto which this persister belongs.getFetchable(int position) getFetchMode(int i) getIdByUniqueKey(Object key, String uniquePropertyName, SharedSessionContractImplementor session) getIdentifier(Object entity, SharedSessionContractImplementor session) Get the identifier of an instance from the object's identifier property.getIdentifier(Object entity, MergeContext mergeContext) Get the identifier of an instance from the object's identifier property.String[]String[]getIdentifierAliases(String suffix) Get the result set aliases used for the identifier columns, given a suffixString[]Get the names of columns used to persist the identifierString[]String[]intThe ModelPart describing the identifier/key for this targetDeprecated.Mapping details for the entity's identifier.Get the name of the identifier property (or return null) - need not return the name of an actual Java propertyThe descriptor for the table containing the identifier for the targetThe name of the table defining the identifier for this targetGet the identifier typeGet the database-specific SQL command to retrieve the last generated IDENTITY value.Get the insert coordinator instance.Deprecated, for removal: This API element is subject to removal in a future version.getJdbcMapping(int index) intThe number of JDBC mappings@Nullable StringThe JPA entity name, if one, associated with the entity.getKeyFetchable(int position) protected Map<String, SingleIdArrayLoadPlan> final Class<?> The persistent class, or nullJavaType<?> The descriptor descriptor for the mapped Java typeGet the name of the entity that is the "super class" for this entityGet the merge coordinator instance.Access to performing multi-value natural-id database selection.Get the NaturalId cache (optional operation)int[]If the entity defines a natural id, that is, ifEntityPersister.hasNaturalIdentifier()returnstrue, the indices of the properties which make up the natural id.Retrieve the current state of the natural-id properties from the database.Access to performing natural-id database selection.The mapping for the natural-id of the entity, if one is definedThe model role of this targetboolean[]intThe total number of attributes for this entity, including those declared on supertype mappingsintGet the number of attributes defined on this entity mapping - do not access attributes defined on the superintThe number of fetchables in the containerintThe number of fetchables in the containerThe local part name, which is generally the unqualified role nameString[]getPropertyAliases(String suffix, int i) Get the result set aliases used for the property columns, given a suffix (properties of this class, only).Get the cascade styles of the properties (optional operation)boolean[]Get the "checkability" of the properties of this class (is the property dirty checked, does the cache need to be updated)String[]getPropertyColumnNames(int i) String[]getPropertyColumnNames(String propertyName) Get the column names for the given property pathintgetPropertyIndex(String propertyName) boolean[]Get the "insertability" of the properties of this class (does the property appear in an SQL INSERT)boolean[]String[]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[]Get the nullability of the properties of this classintprotected abstract int[]getPropertyType(String propertyName) Deprecated.by the supertypesType[]Get the Hibernate types of the class propertiesboolean[]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!)getPropertyValue(Object object, int i) getPropertyValue(Object object, String propertyName) Get the value of a particular propertyObject[]getPropertyValues(Object object) Object[]getPropertyValuesToInsert(Object entity, Map<Object, Object> mergeMap, SharedSessionContractImplementor session) Return the values of the insertable properties of the object (including backrefs)boolean[]Get the "versionability" of the properties of this class (is the property optimistic-locked)protected StringgetPrunedDiscriminatorPredicate(Map<String, EntityNameUse> entityNameUses, MappingMetamodelImplementor mappingMetamodel, String alias) Returns an array of objects that identify spaces in which properties of this entity are persisted, for instances of this class and its subclasses.Describes how the entity is represented in the application's domain model.Returns an object that identifies the space in which identifiers of this entity hierarchy are unique.String[]Get the names of columns on the root table used to persist the identifier.String[]The names of the primary key columns in the root table.Locks are always applied to the "root table".The mapping for the row-id of the entity, if one is defined.getSelectByUniqueKeyString(String propertyName) Get a SQL select string that performs a select based on a unique key determined by the given property name.getSelectByUniqueKeyString(String[] propertyNames) Get a SQL select string that performs a select based on a unique key determined by the given property names.getSelectByUniqueKeyString(String[] propertyNames, String[] columnNames) Mapping for soft-delete support, ornullif soft-delete not definedGet the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generatedprotected StringThe strategy to use for SQM mutation statements where the target entity has multiple tables.protected intgetStateArrayInitialPosition(MappingModelCreationProcess creationProcess) protected AttributeMappingsListprotected String[]Deprecated.Hibernate no longer uses aliases to read from result setsgetSubclassEntityPersister(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[]Deprecated.Hibernate no longer uses aliases to read from result setsString[]getSubclassPropertyColumnAliases(String propertyName, String suffix) Deprecated.Hibernate no longer uses aliases to read from result setsprotected String[][]String[]String[][]String[][]String[][]protected String[]getSubclassPropertyType(int i) protected Type[]protected abstract String[]getSubclassTableKeyColumns(int j) protected abstract String[]Retrieve mappings for all subtypesThe mapping for the entity which is the supertype for this entity mapping.static intgetTableId(String tableName, String[] tables) protected EntityTableMappinggetTableMapping(int i) getTableNameForColumn(String columnName) String[]The ModelPart describing the mutation targetprotected SingleUniqueKeyEntityLoader<?> getUniqueKeyLoader(String attributeName, SharedSessionContractImplementor session) Get the update coordinator instance.getVersion(Object object) Get the version number (or timestamp) from the object's version property.For versioned entities, get the name of the column (again, expected on the root table) used to store the version values.Mapping details for the entity's version when using the version strategy.intIfEntityPersister.isVersioned(), then what is the index of the property holding the locking value.BasicType<?> IfEntityPersister.isVersioned(), then what is the type of the property holding the locking value.booleanhasCache()Does this class have a cache.booleanDetermine whether this entity has any delete cascading.booleanDetermine whether this entity has any persist cascading.booleanDetermine whether this entity has any cascading operations.booleanDetermine whether this entity contains references to persistent collections not referencing the primary key.booleanDetermine whether this entity contains references to persistent collections.booleanbooleanbooleanDetermine whether the entity has a particular property holding the identifier value.booleanDoes this entity define any properties as being database generated on insert?booleanDetermine whether this entity defines any lazy properties (when bytecode instrumentation is enabled).booleanbooleanDetermine whether any properties of this entity are considered mutable.booleanDoes this class have a natural id cachebooleanDetermine whether this entity defines a natural identifier.booleanDetermine whether this entity has any owned collections.booleanbooleanhasProxy()Determine whether this entity supports dynamic proxies.booleanhasRowId()Does the result set contain rowids?booleanWhether this entity mapping has any subtype mappingsbooleanDetermine whether this entity contains references to persistent collections which are fetchable by subselect?booleanDetermine whether this entity has any many-to-one or one-to-one associations.booleanhasUninitializedLazyProperties(Object object) Does the given instance have any uninitialized lazy properties?booleanDoes this entity define any properties as being database generated on update?booleanDoes this restrictable have a where restriction?initializeEnhancedEntityUsedAsProxy(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 voidinitializeLazyProperty(Object entity, EntityEntry entry, Object propValue, int index, Type type) protected booleaninitializeLazyProperty(String fieldName, Object entity, EntityEntry entry, int index, Object propValue) Called by Hibernate Reactiveprotected booleaninitializeLazyProperty(String fieldName, Object entity, EntityEntry entry, LazyAttributeDescriptor fetchGroupAttributeDescriptor, Object propValue) initializeLazyProperty(String fieldName, Object entity, SharedSessionContractImplementor session) Initialize the property, and return its new value.initInsertGeneratedProperties(List<AttributeMapping> generatedAttributes) protected voidinitPropertyPaths(Metadata mapping) protected voidDeprecated.Hibernate no longer uses aliases to read from result setsinitUpdateGeneratedProperties(List<AttributeMapping> generatedAttributes) instantiate(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) booleanWhether this entity is defined as abstract using the JavaabstractkeywordbooleanisAffectedByEnabledFetchProfiles(LoadQueryInfluencers loadQueryInfluencers) Whether any of the LoadQueryInfluencers.getEnabledFetchProfileNames() apply to this loadablebooleanisAffectedByEnabledFilters(LoadQueryInfluencers loadQueryInfluencers, boolean onlyApplyForLoadByKeyFilters) Whether any of the "influencers" affect this loadable.booleanisAffectedByEntityGraph(LoadQueryInfluencers loadQueryInfluencers) Whether the effective entity-graph applies to this loadablebooleanWe 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) booleanReturnstrueif this entity type's hierarchy is configured to return concrete-typed proxies.protected booleanbooleanIs this class explicit polymorphism only?booleanAre 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) booleanDetermine whether the entity is inherited one or more other entities.booleanisInstance(Object object) Is the given object an instance of this entity?booleanHas the class actually been bytecode instrumented?booleanisInverseTable(int j) booleanShould lazy properties of this entity be cached?booleanDetermine whether instances of this entity are considered mutable.protected booleanisNonLazyPropertyName(String fieldName) protected booleanisNullableSubclassTable(int j) booleanisNullableTable(int j) protected booleanabstract booleanisPropertyOfTable(int property, int j) booleanisPropertySelectable(int propertyNumber) booleanIs select snapshot before update enabled?booleanisSharedColumn(String columnExpression) booleanisSubclassEntityName(String entityName) Determine whether the given name represents a subclass entity (or this entity itself) of the entity mapped by this persister.protected booleanisSubclassTableIndicatedByTreatAsDeclarations(int subclassTableNumber, Set<String> treatAsDeclarations) abstract booleanisTableCascadeDeleteEnabled(int j) isTransient(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 mappingbooleanDetermine whether optimistic locking by column is enabled for this entity.booleanbooleanbooleanDoes this entity contain a version property that is defined to be database generated?protected voidlinkToSession(Object entity, SharedSessionContractImplementor session) voidlinkWithSubType(EntityMappingType sub, MappingModelCreationProcess creationProcess) voidlinkWithSuperType(MappingModelCreationProcess creationProcess) Link an entity type with its super-type, if one.load(Object id, Object optionalObject, LockMode lockMode, SharedSessionContractImplementor session) Load an instance using either theforUpdateLoaderor the outer joiningloader, depending upon the value of thelockparameterload(Object id, Object optionalObject, LockOptions lockOptions, SharedSessionContractImplementor session) Load an instance using either theforUpdateLoaderor the outer joiningloader, depending upon the value of thelockparameterload(Object id, Object optionalObject, LockOptions lockOptions, SharedSessionContractImplementor session, Boolean readOnly) loadByUniqueKey(String propertyName, Object uniqueKey, Boolean readOnly, SharedSessionContractImplementor session) loadByUniqueKey(String propertyName, Object uniqueKey, SharedSessionContractImplementor session) Load an instance of the persistent class, by a unique key other than the primary key.loadEntityIdByNaturalId(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, SharedSessionContractImplementor session) Do a version check (optional operation)voidDo a version check (optional operation)voidlock(Object id, Object version, Object object, LockOptions lockOptions, SharedSessionContractImplementor 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 voidbooleanmanagesColumns(String[] columnNames) List<?> multiLoad(Object[] ids, SharedSessionContractImplementor session, MultiIdLoadOptions loadOptions) Performs a load of multiple entities (of this type) by identifier simultaneously.List<?> multiLoad(Object[] ids, EventSource session, MultiIdLoadOptions loadOptions) Performs a load of multiple entities (of this type) by identifier simultaneously.abstract booleanfinal OptimisticLockStyleThe type of optimistic locking, if any, defined for this entity mappingphysicalTableNameForMutation(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.final voidFinish the initialization of this object.voidPrepare loaders associated with the persister.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, GeneratedValues generatedValues, SharedSessionContractImplementor session) Retrieve the values of any insert generated properties through the providedGeneratedValuesor, when that's not available, by selecting them 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, GeneratedValues generatedValues, SharedSessionContractImplementor session) Retrieve the values of any update generated properties through the providedGeneratedValuesor, when that's not available, by selecting them 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 profile name with the entity/collectionvoidresetIdentifier(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 metamodelIf this entity is configured to return concrete-typed proxies, this method queries the entity table(s) do determine the concrete entity type associated with the provided id and returns its persister.int[]resolveDirtyAttributeIndexes(Object[] currentState, Object[] previousState, String[] attributeNames, SessionImplementor session) LikeEntityPersister.resolveAttributeIndexes(String[])but also always returns mutable attributesselectFragment(String alias, String suffix) All columns to select, when loading.voidsetIdentifier(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.voidsetPropertyValues(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 booleanbooleanprotected StringsubstituteBrackets(String sql) String[]Given a property path, return the corresponding column name(s).toString()booleanprotected voidvoidvisitAttributeMappings(Consumer<? super AttributeMapping> action) 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 voidVisit details about each table for this entity, using "mutability ordering".voidvisitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType) voidvisitSubTypeAttributeMappings(Consumer<? super AttributeMapping> action) Walk this type's attributes as well as its subtypesvoidvisitSuperTypeAttributeMappings(Consumer<? super AttributeMapping> action) Walk this type's attributes as well as its super-type'sMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValueMethods inherited from interface org.hibernate.metamodel.mapping.EntityMappingType
asEntityMappingType, extractConcreteTypeStateValues, findContainingEntityMapping, findSubPart, getContributor, getDiscriminatorSQLValue, getDiscriminatorValue, getIdentifierMappingForJoin, getIdentifierTableDetails, getJavaType, getMappedTableDetails, getPartMappingType, getRootEntityDescriptor, getRootPathName, getSoftDeleteTableDetails, getSubclassEntityNames, getSubclassId, isTypeOrSuperType, pruneForSubclasses, visitConstraintOrderedTablesMethods inherited from interface org.hibernate.persister.entity.mutation.EntityMutationTarget
getAttributeMutationTableName, getIdentityInsertDelegate, getMutationDelegateMethods inherited from interface org.hibernate.persister.entity.EntityPersister
addToCacheKey, breakDownJdbcValues, canExtractIdOutOfEntity, delete, getConstraintOrderedTableKeyColumnClosure, getEntityMappingType, getFilterAliasGenerator, getFilterAliasGenerator, getGeneratedProperties, getIdentifier, getImportedName, getKeyColumns, getPropertySpaces, getSubclassTableName, getSubclassTableSpan, getSynchronizationSpaces, getSynchronizedQuerySpaces, getTableName, getTableName, getTableSpan, getTypeDiscriminatorMetadata, getValue, getValues, getVersionJavaType, hasDuplicateTables, insert, insert, isBatchLoadable, load, merge, processInsertGeneratedProperties, processUpdateGeneratedProperties, setValue, setValues, update, visitQuerySpacesMethods inherited from interface org.hibernate.metamodel.mapping.EntityValuedModelPart
forEachSubPartMethods inherited from interface org.hibernate.sql.results.graph.FetchableContainer
getNumberOfKeyFetchables, getSelectableIndex, visitFetchables, visitKeyFetchablesMethods inherited from interface org.hibernate.metamodel.mapping.FilterRestrictable
applyFilterRestrictionsMethods inherited from interface org.hibernate.metamodel.mapping.JdbcMappingContainer
getSingleJdbcMappingMethods inherited from interface org.hibernate.loader.ast.spi.Loadable
isAffectedByEnabledFilters, isAffectedByInfluencers, isAffectedByInfluencers, isNotAffectedByInfluencersMethods inherited from interface org.hibernate.metamodel.mapping.ManagedMappingType
anyRequiresAggregateColumnWriter, isAffectedByEnabledFiltersMethods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, asAttributeMapping, asBasicValuedModelPart, breakDownJdbcValues, decompose, decompose, forEachSelectable, isEntityIdentifierMapping, isVirtualMethods inherited from interface org.hibernate.metamodel.mapping.ModelPartContainer
findByPath, findByPath, forEachSubPartMethods inherited from interface org.hibernate.sql.model.MutationTarget
getRolePathMethods inherited from interface org.hibernate.metamodel.mapping.Restrictable
applyBaseRestrictions
-
Field Details
-
ENTITY_CLASS
- See Also:
-
VERSION_COLUMN_ALIAS
- See Also:
-
ROWID_ALIAS
- See Also:
-
batchSize
protected final int batchSize -
rowIdName
-
insertGeneratedProperties
-
updateGeneratedProperties
-
declaredAttributeMappings
-
staticFetchableList
-
accessOptimizer
-
fullDiscriminatorSQLValues
-
insertExpectations
Deprecated. -
updateExpectations
Deprecated. -
deleteExpectations
Deprecated. -
insertCallable
Deprecated. -
updateCallable
Deprecated. -
deleteCallable
Deprecated. -
customSQLInsert
Deprecated. -
customSQLUpdate
Deprecated. -
customSQLDelete
Deprecated.
-
-
Constructor Details
-
AbstractEntityPersister
public AbstractEntityPersister(PersistentClass persistentClass, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy, RuntimeModelCreationContext creationContext) throws HibernateException - Throws:
HibernateException
-
-
Method Details
-
buildSingleIdEntityLoader
For Hibernate Reactive -
getEntityNameByTableNameMap
public static Map<String,String> getEntityNameByTableNameMap(PersistentClass persistentClass, SqlStringGenerationContext stringGenerationContext) -
buildMultiIdLoader
Used by Hibernate Reactive -
getSubclassTableNames
-
getSubclassTableKeyColumns
-
isClassOrSuperclassTable
protected abstract boolean isClassOrSuperclassTable(int j) -
isClassOrSuperclassJoin
protected boolean isClassOrSuperclassJoin(int j) -
isPropertyOfTable
public abstract boolean isPropertyOfTable(int property, int j) -
getPropertyTableNumbers
protected abstract int[] getPropertyTableNumbers() -
getDiscriminatorColumnName
- Specified by:
getDiscriminatorColumnNamein interfaceEntityPersister- Returns:
- the column name for the discriminator as specified in the mapping.
-
getDiscriminatorColumnReaders
-
getDiscriminatorColumnReaderTemplate
-
getDiscriminatorFormulaTemplate
-
isInverseTable
public boolean isInverseTable(int j) - Specified by:
isInverseTablein interfaceEntityPersister
-
isNullableTable
public boolean isNullableTable(int j) - Specified by:
isNullableTablein interfaceEntityPersister
-
isNullableSubclassTable
protected boolean isNullableSubclassTable(int j) -
isSubclassEntityName
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.
-
getRootTableKeyColumnNames
Description copied from interface:EntityPersisterThe names of the primary key columns in the root table.- Specified by:
getRootTableKeyColumnNamesin interfaceEntityPersister- Returns:
- The primary key column names.
-
getInsertCoordinator
Description copied from interface:EntityPersisterGet the insert coordinator instance.- Specified by:
getInsertCoordinatorin interfaceEntityPersister
-
getUpdateCoordinator
Description copied from interface:EntityPersisterGet the update coordinator instance.- Specified by:
getUpdateCoordinatorin interfaceEntityPersister
-
getDeleteCoordinator
Description copied from interface:EntityPersisterGet the delete coordinator instance.- Specified by:
getDeleteCoordinatorin interfaceEntityPersister
-
getMergeCoordinator
Description copied from interface:EntityPersisterGet the merge coordinator instance.- Specified by:
getMergeCoordinatorin interfaceEntityPersister
-
getVersionSelectString
-
getInsertGeneratedValuesProcessor
-
getUpdateGeneratedValuesProcessor
-
hasRowId
public boolean hasRowId()Description copied from interface:EntityPersisterDoes the result set contain rowids?- Specified by:
hasRowIdin interfaceEntityPersister
-
getTableNames
- Specified by:
getTableNamesin interfaceEntityPersister
-
buildCacheEntryHelper
protected AbstractEntityPersister.CacheEntryHelper buildCacheEntryHelper(SessionFactoryOptions options) -
canUseReferenceCacheEntries
public boolean canUseReferenceCacheEntries()- Specified by:
canUseReferenceCacheEntriesin interfaceEntityPersister
-
useShallowQueryCacheLayout
public boolean useShallowQueryCacheLayout()- Specified by:
useShallowQueryCacheLayoutin interfaceEntityPersister
-
storeDiscriminatorInShallowQueryCacheLayout
public boolean storeDiscriminatorInShallowQueryCacheLayout()- Specified by:
storeDiscriminatorInShallowQueryCacheLayoutin interfaceEntityPersister
-
hasFilterForLoadByKey
public boolean hasFilterForLoadByKey()- Specified by:
hasFilterForLoadByKeyin interfaceEntityPersister
-
uniqueKeyEntries
- Specified by:
uniqueKeyEntriesin interfaceEntityPersister- Returns:
- Metadata for each unique key defined
-
getLazyLoadPlanByFetchGroup
-
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:
-
containsTableReference
- Specified by:
containsTableReferencein interfaceTableGroupProducer
-
getPartName
Description copied from interface:ModelPartThe local part name, which is generally the unqualified role name- Specified by:
getPartNamein interfaceEntityMappingType- Specified by:
getPartNamein interfaceModelPart
-
getNaturalIdMapping
Description copied from interface:EntityMappingTypeThe mapping for the natural-id of the entity, if one is defined- Specified by:
getNaturalIdMappingin interfaceEntityMappingType
-
createPrimaryTableReference
public TableReference createPrimaryTableReference(SqlAliasBase sqlAliasBase, SqlAstCreationState sqlAstCreationState) - Specified by:
createPrimaryTableReferencein interfaceEntityMappingType
-
createTableReferenceJoin
public TableReferenceJoin createTableReferenceJoin(String joinTableExpression, SqlAliasBase sqlAliasBase, TableReference lhs, SqlAstCreationState creationState) - Specified by:
createTableReferenceJoinin interfaceEntityMappingType
-
generateTableReferenceJoin
protected TableReferenceJoin generateTableReferenceJoin(TableReference lhs, String joinTableExpression, SqlAliasBase sqlAliasBase, boolean innerJoin, String[] targetColumns, SqlAstCreationState creationState) -
generateJoinPredicate
protected Predicate generateJoinPredicate(TableReference rootTableReference, TableReference joinedTableReference, String[] pkColumnNames, String[] fkColumnNames, SqlAstCreationState creationState) -
isNonLazyPropertyName
-
initializeLazyProperty
protected boolean initializeLazyProperty(String fieldName, Object entity, EntityEntry entry, int index, Object propValue) Called by Hibernate Reactive -
initializeLazyProperty
protected boolean initializeLazyProperty(String fieldName, Object entity, EntityEntry entry, LazyAttributeDescriptor fetchGroupAttributeDescriptor, Object propValue) -
initializeLazyProperty
protected void initializeLazyProperty(Object entity, EntityEntry entry, Object propValue, int index, Type type) -
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.
-
getBatchSize
public int getBatchSize()Description copied from interface:EntityPersisterThe batch size for batch loading.- Specified by:
getBatchSizein interfaceEntityPersister- Specified by:
getBatchSizein interfaceLoadable- See Also:
-
getIdentifierColumnNames
Description copied from interface:EntityPersisterGet the names of columns used to persist the identifier- Specified by:
getIdentifierColumnNamesin interfaceEntityPersister
-
getIdentifierColumnReaders
-
getIdentifierColumnReaderTemplates
-
getIdentifierColumnSpan
public int getIdentifierColumnSpan() -
getIdentifierAliases
-
getVersionColumnName
Description copied from interface:EntityPersisterFor versioned entities, get the name of the column (again, expected on the root table) used to store the version values.- Specified by:
getVersionColumnNamein interfaceEntityPersister- Returns:
- The version column name.
-
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
Description copied from interface:EntityPersisterAll columns to select, when loading.- Specified by:
selectFragmentin interfaceEntityPersister
-
getIdentifierAliases
Description copied from interface:EntityPersisterGet the result set aliases used for the identifier columns, given a suffix- Specified by:
getIdentifierAliasesin interfaceEntityPersister
-
getPropertyAliases
Description copied from interface:EntityPersisterGet the result set aliases used for the property columns, given a suffix (properties of this class, only).- Specified by:
getPropertyAliasesin interfaceEntityPersister
-
getDiscriminatorAlias
Description copied from interface:EntityPersisterGet the result set aliases used for the identifier columns, given a suffix- Specified by:
getDiscriminatorAliasin interfaceEntityPersister
-
generateSelectVersionString
Generate the SQL that selects the version number by id -
createGeneratedValuesProcessor
protected GeneratedValuesProcessor createGeneratedValuesProcessor(EventType timing, List<AttributeMapping> generatedAttributes) -
getJdbcMapping
- Specified by:
getJdbcMappingin interfaceJdbcMappingContainer
-
generateLocker
-
lock
Description copied from interface:EntityPersisterDo a version check (optional operation)- Specified by:
lockin interfaceEntityPersister
-
lock
public void lock(Object id, Object version, Object object, LockOptions lockOptions, EventSource session) Description copied from interface:EntityPersisterDo a version check (optional operation)- Specified by:
lockin interfaceEntityPersister
-
getRootTableName
Description copied from interface:EntityPersisterLocks are always applied to the "root table".- Specified by:
getRootTableNamein interfaceEntityPersister- Returns:
- The root table name
-
getRootTableIdentifierColumnNames
Description copied from interface:EntityPersisterGet the names of columns on the root table used to persist the identifier.- Specified by:
getRootTableIdentifierColumnNamesin interfaceEntityPersister- Returns:
- The root table identifier column names.
-
toColumns
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 interfaceEntityPersister- Throws:
QueryException
-
getPropertyColumnNames
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 interfaceEntityPersister
-
getDiscriminatorDomainType
Description copied from interface:EntityPersisterThe type of the discriminator, ornullif the entity does not have a discriminator.- Specified by:
getDiscriminatorDomainTypein interfaceEntityPersister- Returns:
- a
DiscriminatorTypeornull - See Also:
-
generateTableAlias
-
getPropertyColumnNames
-
hasFormulaProperties
public boolean hasFormulaProperties() -
getFetchMode
-
getSubclassPropertyType
-
countSubclassProperties
public int countSubclassProperties()- Specified by:
countSubclassPropertiesin interfaceEntityPersister
-
getSubclassPropertyColumnNames
- Specified by:
getSubclassPropertyColumnNamesin interfaceEntityPersister
-
getSubclassPropertyFormulaTemplateClosure
-
getSubclassPropertyTypeClosure
-
getSubclassPropertyColumnNameClosure
-
getSubclassPropertyColumnReaderClosure
-
getSubclassPropertyColumnReaderTemplateClosure
-
getSubclassPropertyNameClosure
-
resolveAttributeIndexes
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 interfaceEntityPersister- Parameters:
attributeNames- Array of names to be resolved- Returns:
- A set of unique indexes of the attribute names found in the metamodel
-
getPropertyIndex
- Specified by:
getPropertyIndexin interfaceAttributeSource
-
initPropertyPaths
- Throws:
MappingException
-
getIdentitySelectString
Description copied from interface:EntityPersisterGet the database-specific SQL command to retrieve the last generated IDENTITY value.- Specified by:
getIdentitySelectStringin interfaceEntityPersister- Returns:
- The SQL command string
-
getSelectByUniqueKeyString
Description copied from interface:EntityPersisterGet a SQL select string that performs a select based on a unique key determined by the given property name.- Specified by:
getSelectByUniqueKeyStringin interfaceEntityPersister- 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
Description copied from interface:EntityPersisterGet a SQL select string that performs a select based on a unique key determined by the given property names.- Specified by:
getSelectByUniqueKeyStringin interfaceEntityPersister- 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
-
getSelectByUniqueKeyString
- Specified by:
getSelectByUniqueKeyStringin interfaceEntityPersister
-
getInsertDelegate
- Specified by:
getInsertDelegatein interfaceEntityMutationTarget
-
getUpdateDelegate
- Specified by:
getUpdateDelegatein interfaceEntityMutationTarget
-
getTableMappings
- Specified by:
getTableMappingsin interfaceEntityMutationTarget
-
getTableMapping
-
physicalTableNameForMutation
Unfortunately we cannot directly use `SelectableMapping#getContainingTableExpression()` as that blows up for attributes declared on super-type for union-subclass mappings- Specified by:
physicalTableNameForMutationin interfaceEntityMutationTarget
-
getTargetPart
Description copied from interface:MutationTargetThe ModelPart describing the mutation target- Specified by:
getTargetPartin interfaceEntityMutationTarget- Specified by:
getTargetPartin interfaceMutationTarget<EntityTableMapping>
-
forEachMutableTable
Description copied from interface:MutationTargetVisit each table.- Specified by:
forEachMutableTablein interfaceMutationTarget<EntityTableMapping>
-
forEachMutableTableReverse
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
Description copied from interface:MutationTargetThe name of the table defining the identifier for this target- Specified by:
getIdentifierTableNamein interfaceMutationTarget<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
Description copied from interface:EntityMutationTargetThe ModelPart describing the identifier/key for this target- Specified by:
getIdentifierDescriptorin interfaceEntityMutationTarget
-
logStaticSQL
protected void logStaticSQL() -
getSubclassByDiscriminatorValue
-
getConstraintOrderedTableNameClosure
-
needsDiscriminator
public abstract boolean needsDiscriminator() -
isDiscriminatorFormula
protected boolean isDiscriminatorFormula() -
applyDiscriminator
public void applyDiscriminator(Consumer<Predicate> predicateConsumer, String alias, TableGroup tableGroup, SqlAstCreationState creationState) Description copied from interface:DiscriminableApply the discriminator as a predicate via thepredicateConsumer- Specified by:
applyDiscriminatorin interfaceDiscriminable- Specified by:
applyDiscriminatorin interfaceEntityMappingType
-
getPrunedDiscriminatorPredicate
protected String getPrunedDiscriminatorPredicate(Map<String, EntityNameUse> entityNameUses, MappingMetamodelImplementor mappingMetamodel, String alias) -
applyFilterRestrictions
public void applyFilterRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String, Filter> enabledFilters, boolean onlyApplyLoadByKeyFilters, 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, boolean onlyApplyLoadByKeyFilters, Set<String> treatAsDeclarations, SqlAstCreationState creationState) Description copied from interface:RestrictableApplies the base set of restrictions.- Specified by:
applyBaseRestrictionsin interfaceEntityMappingType- Specified by:
applyBaseRestrictionsin interfaceRestrictable
-
hasWhereRestrictions
public boolean hasWhereRestrictions()Description copied from interface:WhereRestrictableDoes this restrictable have a where restriction?- Specified by:
hasWhereRestrictionsin interfaceEntityMappingType- Specified by:
hasWhereRestrictionsin interfaceWhereRestrictable
-
applyWhereRestrictions
public void applyWhereRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, SqlAstCreationState creationState) Description copied from interface:WhereRestrictableApply theSQLRestrictionrestrictions- Specified by:
applyWhereRestrictionsin interfaceEntityMappingType- Specified by:
applyWhereRestrictionsin interfaceWhereRestrictable
-
shouldInnerJoinSubclassTable
-
isSubclassTableIndicatedByTreatAsDeclarations
-
postConstruct
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
-
prepareLoaders
public void prepareLoaders()Description copied from interface:EntityPersisterPrepare loaders associated with the persister. Distinct "phase" in building the persister after InFlightEntityMappingType.prepareMappingModel(org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess) and EntityPersister.postInstantiate() have occurred. The distinct phase is used to ensure that all TableDetails are available across the entire model- Specified by:
prepareLoadersin interfaceEntityPersister
-
createInsertDelegate
-
createUpdateDelegate
-
buildTableMappings
Builds the EntityTableMapping descriptors for the tables mapped by this entity.- See Also:
-
visitMutabilityOrderedTables
protected abstract void visitMutabilityOrderedTables(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 among the entity's group of tables.Used while building the table mapping descriptors for each table.
- See Also:
-
isIdentifierTable
-
buildInsertCoordinator
-
buildUpdateCoordinator
-
buildMergeCoordinator
-
buildDeleteCoordinator
-
addDiscriminatorToInsertGroup
- Specified by:
addDiscriminatorToInsertGroupin interfaceEntityMutationTarget
-
addSoftDeleteToInsertGroup
- Specified by:
addSoftDeleteToInsertGroupin interfaceEntityMutationTarget
-
substituteBrackets
-
postInstantiate
Description 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.
-
getSingleIdLoader
-
multiLoad
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
Description copied from interface:FetchProfileAffecteeRegister the profile name with the entity/collection- Specified by:
registerAffectingFetchProfilein interfaceFetchProfileAffectee
-
isAffectedByEntityGraph
Description copied from interface:LoadableWhether the effective entity-graph applies to this loadable- Specified by:
isAffectedByEntityGraphin interfaceEntityMappingType- Specified by:
isAffectedByEntityGraphin interfaceLoadable
-
isAffectedByEnabledFetchProfiles
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, boolean onlyApplyForLoadByKeyFilters) Description copied from interface:LoadableWhether any of the "influencers" affect this loadable.- Specified by:
isAffectedByEnabledFiltersin interfaceEntityMappingType- Specified by:
isAffectedByEnabledFiltersin interfaceLoadable
-
getPropertyUpdateability
Which properties appear in the SQL update? (Initialized, updateable ones!) -
getFactory
Description copied from interface:EntityPersisterReturn theSessionFactoryto which this persister belongs.- Specified by:
getFactoryin interfaceEntityPersister- Returns:
- The owning
SessionFactory.
-
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
Description copied from interface:EntityPersisterGet the cache (optional operation)- Specified by:
getCacheAccessStrategyin interfaceEntityPersister
-
getCacheEntryStructure
Description copied from interface:EntityPersisterGet the cache structure- Specified by:
getCacheEntryStructurein interfaceEntityPersister
-
hasNaturalIdCache
public boolean hasNaturalIdCache()Description copied from interface:EntityPersisterDoes this class have a natural id cache- Specified by:
hasNaturalIdCachein interfaceEntityPersister
-
getNaturalIdCacheAccessStrategy
Description copied from interface:EntityPersisterGet the NaturalId cache (optional operation)- Specified by:
getNaturalIdCacheAccessStrategyin interfaceEntityPersister
-
getEntityName
Description copied from interface:EntityPersisterThe entity name which this persister maps.- Specified by:
getEntityNamein interfaceEntityMappingType- Specified by:
getEntityNamein interfaceEntityPersister- Returns:
- The name of the entity which this persister maps.
-
getJpaEntityName
Description copied from interface:EntityPersisterThe JPA entity name, if one, associated with the entity.- Specified by:
getJpaEntityNamein interfaceEntityPersister
-
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 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 cascading operations.- Specified by:
hasCascadesin interfaceEntityPersister- Returns:
- True if the entity has any properties with a cascade other than NONE; false otherwise (aka, no cascading).
-
hasToOnes
public boolean hasToOnes()Description copied from interface:EntityPersisterDetermine whether this entity has any many-to-one or one-to-one associations.- Specified by:
hasToOnesin interfaceEntityPersister- Returns:
- True if the entity has a many-to-one or one-to-one association; false otherwise.
-
hasCascadePersist
public boolean hasCascadePersist()Description copied from interface:EntityPersisterDetermine whether this entity has any persist cascading.- Specified by:
hasCascadePersistin interfaceEntityPersister- Returns:
- True if the entity has any properties with a cascade PERSIST or ALL; false otherwise.
-
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 REMOVE or ALL; 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 interfaceEntityPersister- Returns:
- True if the entity has a specific property holding identifier value.
-
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 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 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.
-
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 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
-
hasSubclasses
public boolean hasSubclasses()Description copied from interface:EntityMappingTypeWhether this entity mapping has any subtype mappings- Specified by:
hasSubclassesin interfaceEntityMappingType
-
hasProxy
public boolean hasProxy()Description copied from interface:EntityPersisterDetermine whether this entity supports dynamic proxies.- Specified by:
hasProxyin interfaceEntityPersister- Returns:
- True if the entity has dynamic proxy support; false otherwise.
-
getIdentifierGenerator
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
- Specified by:
getGeneratorin interfaceEntityPersister
-
getVersionGenerator
- Specified by:
getVersionGeneratorin interfaceEntityPersister
-
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.
-
getMappedSuperclass
Description copied from interface:EntityMappingTypeGet the name of the entity that is the "super class" for this entity- Specified by:
getMappedSuperclassin interfaceEntityMappingType- See Also:
-
isExplicitPolymorphism
public boolean isExplicitPolymorphism()Description copied from interface:EntityMappingTypeIs this class explicit polymorphism only?- Specified by:
isExplicitPolymorphismin interfaceEntityMappingType
-
isConcreteProxy
public boolean isConcreteProxy()Description copied from interface:EntityMappingTypeReturnstrueif this entity type's hierarchy is configured to return concrete-typed proxies.- Specified by:
isConcreteProxyin interfaceEntityMappingType- See Also:
-
getPropertyType
Deprecated.by the supertypesGet 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 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.
-
isSelectBeforeUpdateRequired
public boolean isSelectBeforeUpdateRequired()Description copied from interface:EntityPersisterIs select snapshot before update enabled?- Specified by:
isSelectBeforeUpdateRequiredin interfaceEntityPersister
-
optimisticLockStyle
Description copied from interface:EntityMappingTypeThe type of optimistic locking, if any, defined for this entity mapping- Specified by:
optimisticLockStylein interfaceEntityMappingType
-
toString
-
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.
-
isVersionGeneratedOnExecution
public boolean isVersionGeneratedOnExecution() -
isVersionGeneratedBeforeExecution
public boolean isVersionGeneratedBeforeExecution() -
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 interfaceEntityPersister
-
getPropertyTypes
Description copied from interface:EntityPersisterGet the Hibernate types of the class properties- Specified by:
getPropertyTypesin interfaceEntityPersister
-
getPropertyLaziness
public boolean[] getPropertyLaziness()- 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()- Specified by:
getNonLazyPropertyUpdateabilityin interfaceEntityPersister
-
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 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
Description copied from interface:EntityPersisterGet the cascade styles of the properties (optional operation)- Specified by:
getPropertyCascadeStylesin interfaceEntityPersister
-
isPropertySelectable
public boolean isPropertySelectable(int propertyNumber) - Specified by:
isPropertySelectablein interfaceEntityPersister
-
getMappedClass
Description copied from interface:EntityPersisterThe persistent class, or null- Specified by:
getMappedClassin interfaceEntityPersister
-
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
Description copied from interface:EntityPersisterSet the given values to the mapped properties of the given object.- Specified by:
setPropertyValuesin interfaceEntityPersister
-
setPropertyValue
Description copied from interface:EntityPersisterSet the value of a particular property of the given instance.- Specified by:
setPropertyValuein interfaceEntityPersister
-
getPropertyValues
- Specified by:
getPropertyValuesin interfaceEntityPersister
-
getPropertyValue
- Specified by:
getPropertyValuein interfaceEntityPersister
-
getPropertyValue
Description copied from interface:EntityPersisterGet the value of a particular property- Specified by:
getPropertyValuein interfaceEntityPersister
-
getIdentifier
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. It's supposed to be use during the merging process- Specified by:
getIdentifierin interfaceEntityPersister
-
getVersion
Description copied from interface:EntityPersisterGet the version number (or timestamp) from the object's version property. Returnnullif it is not versioned.- Specified by:
getVersionin interfaceEntityPersister
-
isInstance
Description copied from interface:EntityPersisterIs the given object an instance of this entity?- Specified by:
isInstancein interfaceEntityPersister
-
hasUninitializedLazyProperties
Description copied from interface:EntityPersisterDoes the given instance have any uninitialized lazy properties?- Specified by:
hasUninitializedLazyPropertiesin 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
-
hasMultipleTables
public boolean hasMultipleTables()- Specified by:
hasMultipleTablesin interfaceEntityPersister
-
getPropertySpan
public int getPropertySpan() -
shouldGetAllProperties
-
initInsertGeneratedProperties
protected List<? extends ModelPart> initInsertGeneratedProperties(List<AttributeMapping> generatedAttributes) -
getInsertGeneratedProperties
- Specified by:
getInsertGeneratedPropertiesin interfaceEntityPersister
-
initUpdateGeneratedProperties
protected List<? extends ModelPart> initUpdateGeneratedProperties(List<AttributeMapping> generatedAttributes) -
getUpdateGeneratedProperties
- Specified by:
getUpdateGeneratedPropertiesin interfaceEntityPersister
-
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 interfaceEntityPersister
-
getIdentifierType
Description copied from interface:EntityPersisterGet the identifier type- 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.
-
hasCollectionNotReferencingPK
public boolean hasCollectionNotReferencingPK()Description copied from interface:EntityPersisterDetermine whether this entity contains references to persistent collections not referencing the primary key.- Specified by:
hasCollectionNotReferencingPKin interfaceEntityPersister- Returns:
- True if the entity contains a collection not referencing the primary key; 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 interfaceEntityPersister- Returns:
- The indices of the properties making up the natural id; or null, if no natural id is defined.
-
verifyHasNaturalId
protected void verifyHasNaturalId() -
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
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
-
hasNaturalIdentifier
public boolean hasNaturalIdentifier()Description copied from interface:EntityPersisterDetermine whether this entity defines a natural identifier.- Specified by:
hasNaturalIdentifierin interfaceEntityPersister- Returns:
- True if the entity defines a natural id; false otherwise.
-
getTableId
-
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
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getInstrumentationMetadatain interfaceEntityPersister
-
getBytecodeEnhancementMetadata
- Specified by:
getBytecodeEnhancementMetadatain interfaceEntityPersister
-
getTableNameForColumn
- Specified by:
getTableNameForColumnin interfaceEntityPersister
-
determineTableNumberForColumn
-
determineTableName
-
getEntityEntryFactory
Description copied from interface:EntityPersisterGet theEntityEntryFactoryindicated for the entity mapped by this persister.- Specified by:
getEntityEntryFactoryin interfaceEntityPersister
-
forEachAttributeMapping
Description copied from interface:EntityMappingTypeVisit each attribute mapping- Specified by:
forEachAttributeMappingin interfaceEntityMappingType- Specified by:
forEachAttributeMappingin interfaceManagedMappingType- See Also:
-
forEachAttributeMapping
Description copied from interface:ManagedMappingTypeVisit attributes defined on this class and any supers- Specified by:
forEachAttributeMappingin interfaceManagedMappingType
-
prepareMappingModel
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
-
generateNaturalIdMapping
protected NaturalIdMapping generateNaturalIdMapping(MappingModelCreationProcess creationProcess, PersistentClass bootEntityDescriptor) -
interpretSqmMultiTableStrategy
protected static SqmMultiTableMutationStrategy interpretSqmMultiTableStrategy(AbstractEntityPersister entityMappingDescriptor, MappingModelCreationProcess creationProcess) -
interpretSqmMultiTableInsertStrategy
protected static SqmMultiTableInsertStrategy interpretSqmMultiTableInsertStrategy(AbstractEntityPersister entityMappingDescriptor, MappingModelCreationProcess creationProcess) -
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
- Specified by:
getSqmMultiTableInsertStrategyin interfaceEntityMappingType- Specified by:
getSqmMultiTableInsertStrategyin interfaceEntityPersister
-
getStateArrayInitialPosition
-
isPhysicalDiscriminator
protected boolean isPhysicalDiscriminator() -
generateDiscriminatorMapping
protected EntityDiscriminatorMapping generateDiscriminatorMapping(PersistentClass bootEntityDescriptor) -
getDiscriminatorType
Description copied from interface:EntityPersisterGet the discriminator type- Specified by:
getDiscriminatorTypein interfaceEntityPersister
-
generateVersionMapping
protected EntityVersionMapping generateVersionMapping(Supplier<?> templateInstanceCreator, PersistentClass bootEntityDescriptor, MappingModelCreationProcess creationProcess) -
shouldProcessSuperMapping
protected boolean shouldProcessSuperMapping() -
linkWithSuperType
Description copied from interface:InFlightEntityMappingTypeLink an entity type with its super-type, if one.- Specified by:
linkWithSuperTypein interfaceInFlightEntityMappingType
-
linkWithSubType
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
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
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
Description copied from interface:EntityMappingTypeVisit attributes defined on this class - do not visit attributes defined on the super- Specified by:
visitDeclaredAttributeMappingsin interfaceEntityMappingType
-
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
Description copied from interface:EntityMappingTypeRetrieve mappings for all subtypes- Specified by:
getSubMappingTypesin interfaceEntityMappingType
-
isTypeOrSuperType
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
-
generateNonIdAttributeMapping
protected AttributeMapping generateNonIdAttributeMapping(NonIdentifierAttribute tupleAttrDefinition, Property bootProperty, int stateArrayPosition, int fetchableIndex, MappingModelCreationProcess creationProcess) -
buildEmbeddedAttributeMapping
protected EmbeddedAttributeMapping buildEmbeddedAttributeMapping(String attrName, int stateArrayPosition, int fetchableIndex, Property bootProperty, DependantValue dependantValue, int dependantColumnIndex, ManagedMappingType declaringType, CompositeType attrType, String tableExpression, String[] rootTableKeyColumnNames, PropertyAccess propertyAccess, CascadeStyle cascadeStyle, MappingModelCreationProcess creationProcess) For Hibernate Reactive -
buildPluralAttributeMapping
protected AttributeMapping buildPluralAttributeMapping(String attrName, int stateArrayPosition, int fetchableIndex, Property bootProperty, ManagedMappingType declaringType, PropertyAccess propertyAccess, CascadeStyle cascadeStyle, FetchMode fetchMode, MappingModelCreationProcess creationProcess) For Hibernate Reactive -
getMappedJavaType
Description copied from interface:MappingTypeThe descriptor descriptor for the mapped Java type- Specified by:
getMappedJavaTypein interfaceEntityMappingType- Specified by:
getMappedJavaTypein interfaceMappingType
-
getEntityPersister
Description copied from interface:EntityMappingTypeSafety-net.- Specified by:
getEntityPersisterin interfaceEntityMappingType
-
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
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:
-
getRowIdMapping
Description copied from interface:EntityMappingTypeThe mapping for the row-id of the entity, if one is defined.- Specified by:
getRowIdMappingin interfaceEntityMappingType
-
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 interfaceDiscriminable- Specified by:
getDiscriminatorMappingin interfaceEntityMappingType
-
getSoftDeleteMapping
Description copied from interface:EntityMappingTypeMapping for soft-delete support, ornullif soft-delete not defined- Specified by:
getSoftDeleteMappingin interfaceEntityMappingType- Specified by:
getSoftDeleteMappingin interfaceSoftDeletableModelPart
-
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
Description copied from interface:EntityMappingTypeFind an attribute-mapping, declared on this entity mapping (not super or subs), by name- Specified by:
findDeclaredAttributeMappingin interfaceEntityMappingType
-
findAttributeMapping
Description copied from interface:ManagedMappingTypeFind an attribute by name.- Specified by:
findAttributeMappingin interfaceManagedMappingType- Returns:
- The named attribute, or
nullif no match was found
-
findSubPart
- Specified by:
findSubPartin interfaceEntityValuedModelPart- Specified by:
findSubPartin interfaceModelPartContainer
-
findSubTypesSubPart
- Specified by:
findSubTypesSubPartin interfaceEntityMappingType
-
visitSubParts
- 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
-
getKeyFetchable
- Specified by:
getKeyFetchablein interfaceFetchableContainer
-
getFetchable
- 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
-
visitAttributeMappings
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
Description copied from interface:EntityMappingTypeWalk this type's attributes as well as its super-type's- Specified by:
visitSuperTypeAttributeMappingsin interfaceEntityMappingType
-
forEachSelectable
Description copied from interface:ModelPartVisits each selectable mapping with the selectable index offset by the given value. Returns the amount of jdbc types that have been visited.- Specified by:
forEachSelectablein interfaceModelPart
-
visitSubTypeAttributeMappings
Description copied from interface:EntityMappingTypeWalk this type's attributes as well as its subtypes- 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
Description copied from interface:JdbcMappingContainerVisit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcTypein interfaceEntityValuedModelPart- Specified by:
forEachJdbcTypein interfaceJdbcMappingContainer
-
hasPartitionedSelectionMapping
public boolean hasPartitionedSelectionMapping()- Specified by:
hasPartitionedSelectionMappingin interfaceManagedMappingType- Specified by:
hasPartitionedSelectionMappingin interfaceModelPart
-
isTableCascadeDeleteEnabled
public abstract boolean isTableCascadeDeleteEnabled(int j) -
getSubclassColumnAliasClosure
Deprecated.Hibernate no longer uses aliases to read from result sets -
getSubclassFormulaAliasClosure
Deprecated.Hibernate no longer uses aliases to read from result sets -
getSubclassPropertyColumnAliases
Deprecated.Hibernate no longer uses aliases to read from result setsDescription copied from interface:EntityPersisterReturn the column alias names used to persist/query the named property of the class or a subclass (optional operation).- Specified by:
getSubclassPropertyColumnAliasesin interfaceEntityPersister
-
initSubclassPropertyAliasesMap
@Deprecated protected void initSubclassPropertyAliasesMap(PersistentClass model) throws MappingException Deprecated.Hibernate no longer uses aliases to read from result setsMust be called by subclasses, at the end of their constructors- Throws:
MappingException
-
getDiscriminatorAlias
-
getSqlWhereStringTableExpression
-
managesColumns
- Specified by:
managesColumnsin interfaceEntityPersister
-