Class CustomEntityPersister

java.lang.Object
org.hibernate.tuple.entity.EntityMetamodel
org.hibernate.persister.entity.AbstractEntityPersister
org.hibernate.persister.entity.SingleTableEntityPersister
ch.tocco.nice2.persist.core.impl.hibernate.CustomEntityPersister
All Implemented Interfaces:
Serializable, org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer, org.hibernate.engine.profile.internal.FetchProfileAffectee, org.hibernate.loader.ast.spi.Loadable, org.hibernate.metamodel.mapping.Bindable, org.hibernate.metamodel.mapping.Discriminable, org.hibernate.metamodel.mapping.EntityMappingType, org.hibernate.metamodel.mapping.EntityValuedModelPart, org.hibernate.metamodel.mapping.FilterRestrictable, org.hibernate.metamodel.mapping.internal.InFlightEntityMappingType, org.hibernate.metamodel.mapping.JdbcMappingContainer, org.hibernate.metamodel.mapping.ManagedMappingType, org.hibernate.metamodel.mapping.MappingModelExpressible, org.hibernate.metamodel.mapping.MappingType, org.hibernate.metamodel.mapping.ModelPart, org.hibernate.metamodel.mapping.ModelPartContainer, org.hibernate.metamodel.mapping.Restrictable, org.hibernate.metamodel.mapping.SoftDeletableModelPart, org.hibernate.metamodel.mapping.WhereRestrictable, org.hibernate.persister.entity.EntityPersister, org.hibernate.persister.entity.Joinable, org.hibernate.persister.entity.mutation.EntityMutationTarget, org.hibernate.persister.walking.spi.AttributeSource, org.hibernate.sql.ast.tree.from.RootTableGroupProducer, org.hibernate.sql.ast.tree.from.TableGroupProducer, org.hibernate.sql.model.MutationTarget<org.hibernate.persister.entity.mutation.EntityTableMapping>, org.hibernate.sql.results.graph.FetchableContainer

public class CustomEntityPersister extends org.hibernate.persister.entity.SingleTableEntityPersister
An EntityPersister implementation with some custom functionality.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.hibernate.persister.entity.AbstractEntityPersister

    org.hibernate.persister.entity.AbstractEntityPersister.CacheEntryHelper, org.hibernate.persister.entity.AbstractEntityPersister.MutabilityOrderedTableConsumer

    Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.Bindable

    org.hibernate.metamodel.mapping.Bindable.JdbcValuesBiConsumer<X,Y>, org.hibernate.metamodel.mapping.Bindable.JdbcValuesConsumer

    Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.EntityMappingType

    org.hibernate.metamodel.mapping.EntityMappingType.ConstraintOrderedTableConsumer

    Nested classes/interfaces inherited from interface org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer

    org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer.InterceptorImplementor

    Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart

    org.hibernate.metamodel.mapping.ModelPart.JdbcValueBiConsumer<X,Y>, org.hibernate.metamodel.mapping.ModelPart.JdbcValueConsumer
  • Field Summary

    Fields inherited from class org.hibernate.persister.entity.AbstractEntityPersister

    accessOptimizer, batchSize, customSQLDelete, customSQLInsert, customSQLUpdate, declaredAttributeMappings, declaredGenericAttributeMappings, deleteCallable, deleteExpectations, ENTITY_CLASS, ENTITY_ID, fullDiscriminatorSQLValues, insertCallable, insertExpectations, insertGeneratedProperties, ROWID_ALIAS, rowIdName, staticFetchableList, updateCallable, updateExpectations, updateGeneratedProperties, VERSION_COLUMN_ALIAS

    Fields inherited from class org.hibernate.tuple.entity.EntityMetamodel

    NO_VERSION_INDX

    Fields inherited from interface org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer

    UNFETCHED_PROPERTY
  • Constructor Summary

    Constructors
    Constructor
    Description
    CustomEntityPersister(org.hibernate.mapping.PersistentClass persistentClass, org.hibernate.cache.spi.access.EntityDataAccess cacheAccessStrategy, org.hibernate.cache.spi.access.NaturalIdDataAccess naturalIdRegionAccessStrategy, org.hibernate.metamodel.spi.RuntimeModelCreationContext creationContext)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.hibernate.persister.entity.mutation.UpdateCoordinator
    As we need a custom UpdateCoordinator the logic of
    invalid reference
    AbstractEntityPersister#buildUpdateCoordinator()
    is copied and the class which is returned is replaced.
    instantiate(Object id, org.hibernate.engine.spi.SharedSessionContractImplementor session)
    Verifies that the entity being instantiated belongs to the current session.
    void
     

    Methods inherited from class org.hibernate.persister.entity.SingleTableEntityPersister

    addDiscriminatorToInsertGroup, getAttributeMutationTableName, getConstraintOrderedTableKeyColumnClosure, getConstraintOrderedTableNameClosure, getDiscriminatorAlias, getDiscriminatorColumnName, getDiscriminatorColumnReaders, getDiscriminatorColumnReaderTemplate, getDiscriminatorFormulaTemplate, getDiscriminatorSQLValue, getDiscriminatorType, getDiscriminatorValue, getFilterAliasGenerator, getIdentifierTableDetails, getKeyColumns, getMappedTableDetails, getPropertySpaces, getPropertyTableNumbers, getSubclassByDiscriminatorValue, getSubclassClosure, getSubclassTableKeyColumns, getSubclassTableName, getSubclassTableNames, getSubclassTableSpan, getTableName, getTableName, getTableSpan, hasDuplicateTables, hasMultipleTables, isClassOrSuperclassJoin, isClassOrSuperclassTable, isDiscriminatorFormula, isIdentifierTable, isInverseTable, isNullableSubclassTable, isNullableTable, isPropertyOfTable, isTableCascadeDeleteEnabled, needsDiscriminator, pruneForSubclasses, visitConstraintOrderedTables, visitMutabilityOrderedTables

    Methods inherited from class org.hibernate.persister.entity.AbstractEntityPersister

    addAuxiliaryToInsertGroup, afterInitialize, afterReassociate, applyBaseRestrictions, applyDiscriminator, applyFilterRestrictions, applySqlSelections, applySqlSelections, applyWhereRestrictions, buildCacheEntry, buildCacheEntryHelper, buildEmbeddedAttributeMapping, buildMultiIdLoader, buildPluralAttributeMapping, buildSingleIdEntityLoader, buildSingularAssociationAttributeMapping, buildTableMappings, canReadFromCache, canUseReferenceCacheEntries, canWriteToCache, containsTableReference, countSubclassProperties, createDomainResult, createGeneratedValuesProcessor, createInsertDelegate, createPrimaryTableReference, createProxy, createRootTableGroup, createTableReferenceJoin, createUpdateDelegate, determineLoaderToUse, determineTableName, determineTableNumberForColumn, disassemble, excludedFromTemporalVersioning, findAttributeMapping, findDeclaredAttributeMapping, findDirty, findModified, findSubPart, findSubTypesSubPart, forceVersionIncrement, forceVersionIncrement, forEachAttributeMapping, forEachAttributeMapping, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachMutableTable, forEachMutableTableReverse, forEachSelectable, forEachTableDetails, generateDiscriminatorMapping, generateIdentifierMapping, generateJoinPredicate, generateLocker, generateNaturalIdMapping, generateNonEncapsulatedCompositeIdentifierMapping, generateNonIdAttributeMapping, generateNonIdAttributeMapping, generateSelectVersionString, generateTableAlias, generateTableReferenceJoin, generateVersionMapping, generateVersionMapping, getAttributeMapping, getAttributeMappings, getAuditMapping, getAuxiliaryMapping, getBatchSize, getCacheAccessStrategy, getCacheEntryStructure, getCollectionKey, getConcreteProxyClass, getCurrentVersion, getDatabaseSnapshot, getDeclaredAttributeMappings, getDeleteCoordinator, getDiscriminatorAlias, getDiscriminatorDomainType, getDiscriminatorMapping, getEntityEntryFactory, getEntityMetamodel, getEntityName, getEntityNameByTableNameMap, getEntityPersister, getFactory, getFetchable, getFetchMode, getGenerator, getIdByUniqueKey, getIdentifier, getIdentifier, getIdentifierAliases, getIdentifierAliases, getIdentifierColumnNames, getIdentifierColumnReaders, getIdentifierColumnReaderTemplates, getIdentifierColumnSpan, getIdentifierDescriptor, getIdentifierGenerator, getIdentifierMapping, getIdentifierPropertyName, getIdentifierTableMapping, getIdentifierTableName, getIdentifierType, getIdentitySelectString, getInsertCoordinator, getInsertDelegate, getInsertGeneratedProperties, getInsertGeneratedValuesProcessor, getInstrumentationMetadata, getJdbcMapping, getJdbcTypeCount, getJpaEntityName, getKeyFetchable, getLazyLoadPlanByFetchGroup, getLocker, getMappedClass, getMappedJavaType, getMappedSuperclass, getMergeCoordinator, getMultiNaturalIdLoader, getNaturalIdCacheAccessStrategy, getNaturalIdentifierSnapshot, getNaturalIdLoader, getNaturalIdMapping, getNavigableRole, getNonLazyPropertyUpdateability, getNumberOfAttributeMappings, getNumberOfDeclaredAttributeMappings, getNumberOfFetchableKeys, getNumberOfFetchables, getPartName, getPropertyAliases, getPropertyCascadeStyles, getPropertyColumnNames, getPropertyColumnNames, getPropertyType, getPropertyUpdateability, getPropertyValue, getPropertyValue, getPropertyValues, getPropertyValuesToInsert, getPrunedDiscriminatorPredicate, getQuerySpaces, getRepresentationStrategy, getRootEntityName, getRootTableIdentifierColumnNames, getRootTableKeyColumnNames, getRootTableName, getRowIdMapping, getSelectByUniqueKeyString, getSelectByUniqueKeyString, getSelectByUniqueKeyString, getSingleIdLoader, getSoftDeleteMapping, getSqlAliasStem, getSqlWhereStringTableExpression, getSqmMultiTableInsertStrategy, getSqmMultiTableMutationStrategy, getStateArrayInitialPosition, getStaticFetchableList, getSubclassColumnAliasClosure, getSubclassEntityPersister, getSubclassFormulaAliasClosure, getSubclassPropertyColumnAliases, getSubclassPropertyColumnNameClosure, getSubclassPropertyColumnNames, getSubclassPropertyColumnReaderClosure, getSubclassPropertyColumnReaderTemplateClosure, getSubclassPropertyFormulaTemplateClosure, getSubclassPropertyNameClosure, getSubclassPropertyType, getSubclassPropertyTypeClosure, getSubMappingTypes, getSuperMappingType, getTableId, getTableMapping, getTableMappings, getTableNameForColumn, getTableNames, getTargetPart, getTemporalMapping, getUniqueKeyLoader, getUpdateCoordinator, getUpdateDelegate, getUpdateGeneratedProperties, getUpdateGeneratedValuesProcessor, getVersion, getVersionColumnName, getVersionedTableName, getVersionGenerator, getVersionMapping, getVersionSelectString, getVersionType, hasCache, hasCollectionNotReferencingPK, hasFilterForLoadByKey, hasFormulaProperties, hasIdentifierProperty, hasInsertGeneratedProperties, hasNaturalIdCache, hasPartitionedSelectionMapping, hasPreInsertGeneratedProperties, hasPreUpdateGeneratedProperties, hasProxy, hasRowId, hasSubselectLoadableCollections, hasUninitializedLazyProperties, hasUpdateGeneratedProperties, hasWhereRestrictions, initializeEnhancedEntityUsedAsProxy, initializeLazyPropertiesFromCache, initializeLazyPropertiesFromDatastore, initializeLazyProperty, initializeLazyProperty, initializeLazyProperty, initializeLazyProperty, initInsertGeneratedProperties, initPropertyPaths, initSubclassPropertyAliasesMap, initUpdateGeneratedProperties, interpretSqmMultiTableInsertStrategy, interpretSqmMultiTableStrategy, isAffectedByEnabledFetchProfiles, isAffectedByEnabledFilters, isAffectedByEnabledFilters, isAffectedByEntityGraph, isAffectedByInfluencers, isCacheInvalidationRequired, isConcreteProxy, isIdentifierAssignedByInsert, isInstance, isInstrumented, isLazyPropertiesCacheable, isNonLazyPropertyName, isPhysicalDiscriminator, isPropertyAuditedExcluded, isPropertyTemporalExcluded, isSelectBeforeUpdateRequired, isSharedColumn, isSubclassEntityName, isSubclassTableIndicatedByTreatAsDeclarations, isTransient, isTypeOrSuperType, isVersionGeneratedBeforeExecution, isVersionGeneratedOnExecution, isVersionPropertyGenerated, linkToSession, linkWithSubType, linkWithSuperType, load, load, load, loadByUniqueKey, loadByUniqueKey, loadEntityIdByNaturalId, lock, lock, lock, lock, logStaticSQL, managesColumns, multiLoad, multiLoad, optimisticLockStyle, physicalTableNameForMutation, postConstruct, postInstantiate, prepareLoaders, prepareMappingModel, processInsertGeneratedProperties, processUpdateGeneratedProperties, registerAffectingFetchProfile, resetIdentifier, resolveAttributeIndexes, resolveConcreteProxyTypeForId, resolveDirtyAttributeIndexes, selectFragment, setIdentifier, setPropertyValue, setPropertyValues, shouldGetAllProperties, shouldInnerJoinSubclassTable, shouldProcessSuperMapping, storeDiscriminatorInShallowQueryCacheLayout, substituteBrackets, toColumns, toString, uniqueKeyEntries, useShallowQueryCacheLayout, verifyHasNaturalId, visitAttributeMappings, visitDeclaredAttributeMappings, visitFetchables, visitFetchables, visitKeyFetchables, visitKeyFetchables, visitSubParts, visitSubTypeAttributeMappings, visitSuperTypeAttributeMappings

    Methods inherited from class org.hibernate.tuple.entity.EntityMetamodel

    getBytecodeEnhancementMetadata, getBytecodeEnhancementMetadataPojo, getCascadeStyles, getDirtyCheckablePropertyTypes, getEntityType, getGenerators, getIdentifierProperty, getMutablePropertiesIndexes, getName, getNaturalIdentifierProperties, getNonlazyPropertyUpdateability, getOptimisticLockStyle, getProperties, getPropertyCheckability, getPropertyIndex, getPropertyIndexOrNull, getPropertyInsertability, getPropertyLaziness, getPropertyNames, getPropertyNullability, getPropertyOnDeleteActions, getPropertySpan, getPropertyTypes, getPropertyUpdateability, getPropertyVersionability, getRootName, getSessionFactory, getSubclassEntityNames, getSubclassId, getSuperclass, getVersionProperty, getVersionPropertyIndex, hasCascadeDelete, hasCascadePersist, hasCascades, hasCollections, hasImmutableNaturalId, hasInsertGeneratedValues, hasLazyProperties, hasMutableProperties, hasNaturalIdentifier, hasNonIdentifierPropertyNamedId, hasOwnedCollections, hasPreInsertGeneratedValues, hasPreUpdateGeneratedValues, hasSubclasses, hasToOnes, hasUpdateGeneratedValues, isAbstract, isDynamicInsert, isDynamicUpdate, isExplicitPolymorphism, isInherited, isLazy, isMutable, isNaturalIdentifierCached, isNaturalIdentifierInsertGenerated, isPolymorphic, isSelectBeforeUpdate, isVersioned, setLazy

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.hibernate.persister.walking.spi.AttributeSource

    getPropertyIndex

    Methods inherited from interface org.hibernate.metamodel.mapping.Bindable

    forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue

    Methods inherited from interface org.hibernate.metamodel.mapping.EntityMappingType

    asEntityMappingType, createRootGraph, extractConcreteTypeStateValues, findContainingEntityMapping, findSubPart, getContributor, getIdentifierMappingForJoin, getJavaType, getPartMappingType, getRootEntityDescriptor, getRootPathName, getSoftDeleteTableDetails, getSubclassEntityNames, getSubclassId, hasSubclasses, isAbstract, isExplicitPolymorphism, isTypeOrSuperType, requireNaturalIdMapping

    Methods inherited from interface org.hibernate.persister.entity.mutation.EntityMutationTarget

    getIdentityInsertDelegate, getMutationDelegate

    Methods inherited from interface org.hibernate.persister.entity.EntityPersister

    addToCacheKey, breakDownJdbcValues, canExtractIdOutOfEntity, delete, getBytecodeEnhancementMetadata, getEntityMappingType, getFilterAliasGenerator, getGeneratedProperties, getGenerators, getIdentifier, getImportedName, getNaturalIdentifierProperties, getPropertyCheckability, getPropertyInsertability, getPropertyLaziness, getPropertyNames, getPropertyNullability, getPropertyOnDeleteActions, getPropertySpan, getPropertyTypes, getPropertyUpdateability, getPropertyVersionability, getSynchronizationSpaces, getSynchronizedQuerySpaces, getTypeDiscriminatorMetadata, getValue, getValues, getVersionJavaType, getVersionPropertyIndex, hasCascadeDelete, hasCascadePersist, hasCascades, hasCollections, hasImmutableNaturalId, hasLazyProperties, hasMutableProperties, hasNaturalIdentifier, hasOwnedCollections, hasToOnes, insert, insert, isBatchLoadable, isDynamicInsert, isDynamicUpdate, isInherited, isLazy, isMutable, isNaturalIdentifierInsertGenerated, isPolymorphic, isVersioned, merge, processInsertGeneratedProperties, processUpdateGeneratedProperties, setValue, setValues, update, visitQuerySpaces

    Methods inherited from interface org.hibernate.metamodel.mapping.EntityValuedModelPart

    forEachSubPart

    Methods inherited from interface org.hibernate.sql.results.graph.FetchableContainer

    getNumberOfKeyFetchables, getSelectableIndex, visitFetchables, visitKeyFetchables

    Methods inherited from interface org.hibernate.metamodel.mapping.FilterRestrictable

    applyFilterRestrictions

    Methods inherited from interface org.hibernate.metamodel.mapping.JdbcMappingContainer

    getSingleJdbcMapping

    Methods inherited from interface org.hibernate.loader.ast.spi.Loadable

    isAffectedByBatchSize, isAffectedByEnabledFilters, isAffectedByInfluencers, isNotAffectedByInfluencers

    Methods inherited from interface org.hibernate.metamodel.mapping.ManagedMappingType

    anyRequiresAggregateColumnWriter, areAttributesAffectedByEnabledFilters

    Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart

    areEqual, asAttributeMapping, asBasicValuedModelPart, breakDownJdbcValues, decompose, decompose, forEachSelectable, isEntityIdentifierMapping, isVirtual

    Methods inherited from interface org.hibernate.metamodel.mapping.ModelPartContainer

    findByPath, findByPath, forEachSubPart

    Methods inherited from interface org.hibernate.sql.model.MutationTarget

    getRolePath

    Methods inherited from interface org.hibernate.metamodel.mapping.Restrictable

    applyBaseRestrictions
  • Constructor Details

    • CustomEntityPersister

      public CustomEntityPersister(org.hibernate.mapping.PersistentClass persistentClass, org.hibernate.cache.spi.access.EntityDataAccess cacheAccessStrategy, org.hibernate.cache.spi.access.NaturalIdDataAccess naturalIdRegionAccessStrategy, org.hibernate.metamodel.spi.RuntimeModelCreationContext creationContext) throws org.hibernate.HibernateException
      Throws:
      org.hibernate.HibernateException
  • Method Details

    • setEntityFactory

      public void setEntityFactory(EntityFactory entityFactory)
    • instantiate

      public Object instantiate(Object id, org.hibernate.engine.spi.SharedSessionContractImplementor session)
      Verifies that the entity being instantiated belongs to the current session. Otherwise a wrong Session and Context would be injected into the entity (see EntityFactoryImpl) which would lead to unexpected behaviour.
      Specified by:
      instantiate in interface org.hibernate.persister.entity.EntityPersister
      Overrides:
      instantiate in class org.hibernate.persister.entity.AbstractEntityPersister
    • buildUpdateCoordinator

      protected org.hibernate.persister.entity.mutation.UpdateCoordinator buildUpdateCoordinator()
      As we need a custom UpdateCoordinator the logic of
      invalid reference
      AbstractEntityPersister#buildUpdateCoordinator()
      is copied and the class which is returned is replaced.
      See Also: