Class CustomEntityPersister

java.lang.Object
org.hibernate.persister.entity.AbstractEntityPersister
org.hibernate.persister.entity.SingleTableEntityPersister
ch.tocco.nice2.persist.core.impl.hibernate.CustomEntityPersister
All Implemented Interfaces:
org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer, org.hibernate.engine.profile.internal.FetchProfileAffectee, org.hibernate.id.PostInsertIdentityPersister, org.hibernate.loader.ast.spi.Loadable, org.hibernate.metadata.ClassMetadata, 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.DeprecatedEntityStuff, org.hibernate.persister.entity.EntityPersister, org.hibernate.persister.entity.Joinable, org.hibernate.persister.entity.Loadable, org.hibernate.persister.entity.Lockable, org.hibernate.persister.entity.mutation.EntityMutationTarget, org.hibernate.persister.entity.OuterJoinLoadable, org.hibernate.persister.entity.PropertyMapping, org.hibernate.persister.entity.Queryable, org.hibernate.persister.entity.SQLLoadable, org.hibernate.persister.entity.UniqueKeyLoadable, 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.
  • Nested Class Summary

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

    org.hibernate.persister.entity.AbstractEntityPersister.CacheEntryHelper

    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

    Nested classes/interfaces inherited from interface org.hibernate.persister.entity.Queryable

    org.hibernate.persister.entity.Queryable.Declarer
  • Field Summary

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

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

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

    ENTITY_ID

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

    UNFETCHED_PROPERTY

    Fields inherited from interface org.hibernate.persister.entity.Loadable

    ROWID_ALIAS
  • Constructor Summary

    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
    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, fromTableFragment, getConstraintOrderedTableNameClosure, getContraintOrderedTableKeyColumnClosure, getDiscriminatorAlias, getDiscriminatorColumnName, getDiscriminatorColumnReaders, getDiscriminatorColumnReaderTemplate, getDiscriminatorFormulaTemplate, getDiscriminatorSQLValue, getDiscriminatorType, getDiscriminatorValue, getFilterAliasGenerator, getIdentifierTableDetails, getKeyColumns, getMappedTableDetails, getPropertySpaces, getPropertyTableNumbers, getSubclassByDiscriminatorValue, getSubclassClosure, getSubclassForDiscriminatorValue, getSubclassPropertyTableName, getSubclassPropertyTableNumber, getSubclassTableKeyColumns, getSubclassTableName, getSubclassTableNames, getSubclassTableSpan, getTableName, getTableName, getTableSpan, hasDuplicateTables, hasMultipleTables, hasSkippableTables, isClassOrSuperclassJoin, isClassOrSuperclassTable, isDiscriminatorFormula, isIdentifierTable, isInverseSubclassTable, isInverseTable, isNullableSubclassTable, isNullableTable, isPropertyOfTable, isTableCascadeDeleteEnabled, needsDiscriminator, pruneForSubclasses, visitConstraintOrderedTables, visitMutabilityOrderedTables

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

    addSoftDeleteToInsertGroup, afterInitialize, afterReassociate, applyBaseRestrictions, applyDiscriminator, applyFilterRestrictions, applySqlSelections, applySqlSelections, applyWhereRestrictions, buildCacheEntry, buildCacheEntryHelper, buildDeleteCoordinator, buildEmbeddedAttributeMapping, buildInsertCoordinator, buildMergeCoordinator, buildMultiIdLoader, buildPluralAttributeMapping, buildSingleIdEntityLoader, buildSingularAssociationAttributeMapping, buildTableMappings, buildUpdateCoordinator, canReadFromCache, canUseReferenceCacheEntries, canWriteToCache, check, checkVersion, consumesCollectionAlias, consumesEntityAlias, containsTableReference, countSubclassProperties, createDomainResult, createGeneratedValuesProcessor, createInsertDelegate, createPrimaryTableReference, createProxy, createRootTableGroup, createTableReferenceJoin, createUpdateDelegate, dehydrate, delete, determineLoaderToUse, determineTableName, determineTableNumberForColumn, disassemble, findAttributeMapping, findDeclaredAttributeMapping, findDirty, findModified, findSubPart, findSubTypesSubPart, forceVersionIncrement, forceVersionIncrement, forEachAttributeMapping, forEachAttributeMapping, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachMutableTable, forEachMutableTableReverse, forEachSelectable, generateDeleteString, generateDiscriminatorMapping, generateFilterConditionAlias, generateIdentifierMapping, generateJoinPredicate, generateLocker, generateNaturalIdMapping, generateNonEncapsulatedCompositeIdentifierMapping, generateNonIdAttributeMapping, generateSelectVersionString, generateSQLDeleteStrings, generateTableAlias, generateTableReferenceJoin, generateVersionMapping, generateVersionMapping, getAttributeMapping, getAttributeMappings, getBatchSize, getBytecodeEnhancementMetadata, getCacheAccessStrategy, getCacheEntryStructure, getCascadeStyle, getClassMetadata, getCollectionKey, getConcreteProxyClass, getCurrentVersion, getDatabaseSnapshot, getDeclaredAttributeMappings, getDeleteCoordinator, getDiscriminatorAlias, getDiscriminatorMapping, getElementTypeDescriptor, getEntityEntryFactory, getEntityMetamodel, getEntityName, getEntityNameByTableNameMap, getEntityPersister, getEntityType, getFactory, getFetchable, getFetchMode, getGenerator, getIdByUniqueKey, getIdentifier, getIdentifierAliases, getIdentifierAliases, getIdentifierColumnNames, getIdentifierColumnReaders, getIdentifierColumnReaderTemplates, getIdentifierColumnSpan, getIdentifierDescriptor, getIdentifierGenerator, getIdentifierMapping, getIdentifierPropertyName, getIdentifierTableMapping, getIdentifierTableName, getIdentifierType, getIdentitySelectString, getInsertCoordinator, getInsertDelegate, getInsertGeneratedProperties, getInsertGeneratedValuesProcessor, getInstrumentationMetadata, getJdbcMapping, getJdbcTypeCount, getKeyColumnNames, getKeyFetchable, getLazyLoadPlanByFetchGroup, getLazyPropertyColumnAliases, getMappedClass, getMappedJavaType, getMappedSuperclass, getMergeCoordinator, getMultiNaturalIdLoader, getName, getNaturalIdCacheAccessStrategy, getNaturalIdentifierProperties, getNaturalIdentifierSnapshot, getNaturalIdLoader, getNaturalIdMapping, getNavigableRole, getNonLazyPropertyUpdateability, getNumberOfAttributeMappings, getNumberOfDeclaredAttributeMappings, getNumberOfFetchableKeys, getNumberOfFetchables, getNumberOfKeyFetchables, getPartName, getPhysicalTableMappingForMutation, getPropertyAliases, getPropertyCascadeStyles, getPropertyCheckability, getPropertyColumnInsertable, getPropertyColumnNames, getPropertyColumnNames, getPropertyColumnSpan, getPropertyColumnUpdateable, getPropertyColumnWriters, getPropertyIndex, getPropertyInsertability, getPropertyLaziness, getPropertyNames, getPropertyNullability, getPropertySpan, getPropertyTableName, getPropertyType, getPropertyTypes, getPropertyUpdateability, getPropertyUpdateability, getPropertyValue, getPropertyValue, getPropertyValues, getPropertyValuesToInsert, getPropertyVersionability, getPrunedDiscriminatorPredicate, getQuerySpaces, getRepresentationStrategy, getRootEntityName, getRootTableAlias, getRootTableIdentifierColumnNames, getRootTableKeyColumnNames, getRootTableName, getRowIdMapping, getSelectByUniqueKeyString, getSelectByUniqueKeyString, getSelectByUniqueKeyString, getSingleIdLoader, getSoftDeleteMapping, getSoftDeleteTableDetails, getSqlAliasStem, getSQLDeleteStrings, getSQLUpdateStrings, getSqlWhereStringTableExpression, getSqmMultiTableInsertStrategy, getSqmMultiTableMutationStrategy, getStateArrayInitialPosition, getStaticFetchableList, getSubclassColumnAliasClosure, getSubclassEntityPersister, getSubclassFormulaAliasClosure, getSubclassPropertyColumnAliases, getSubclassPropertyColumnNameClosure, getSubclassPropertyColumnNames, getSubclassPropertyColumnNames, getSubclassPropertyColumnReaderClosure, getSubclassPropertyColumnReaderTemplateClosure, getSubclassPropertyDeclarer, getSubclassPropertyFormulaTemplateClosure, getSubclassPropertyName, getSubclassPropertyNameClosure, getSubclassPropertyTableNumber, getSubclassPropertyType, getSubclassPropertyTypeClosure, getSubMappingTypes, getSuperMappingType, getTableAliasForColumn, getTableHasColumns, getTableId, getTableMapping, getTableMappings, getTableMappingsCount, getTableNames, getTableUpdateNeeded, getTargetPart, getType, getTypeDiscriminatorMetadata, getUniqueKeyLoader, getUpdateCoordinator, getUpdateDelegate, getUpdateGeneratedProperties, getUpdateGeneratedValuesProcessor, getVersion, getVersionColumnName, getVersionedTableName, getVersionGenerator, getVersionMapping, getVersionProperty, getVersionSelectString, getVersionType, hasAnySkippableTables, hasCache, hasCascadeDelete, hasCascades, hasCollectionNotReferencingPK, hasCollections, hasFormulaProperties, hasIdentifierProperty, hasInsertGeneratedProperties, hasLazyDirtyFields, hasLazyProperties, hasMutableProperties, hasNaturalIdCache, hasNaturalIdentifier, hasOwnedCollections, hasPartitionedSelectionMapping, hasProxy, hasRowId, hasSubclasses, hasSubselectLoadableCollections, hasUninitializedLazyProperties, hasUpdateGeneratedProperties, hasWhereRestrictions, implementsLifecycle, initializeEnhancedEntityUsedAsProxy, initializeLazyPropertiesFromCache, initializeLazyPropertiesFromDatastore, initializeLazyProperty, initializeLazyProperty, initInsertGeneratedProperties, initPropertyPaths, initSubclassPropertyAliasesMap, initUpdateGeneratedProperties, interpretSqmMultiTableInsertStrategy, interpretSqmMultiTableStrategy, isAbstract, isAffectedByEnabledFetchProfiles, isAffectedByEnabledFilters, isAffectedByEntityGraph, isAllNull, isAllOrDirtyOptLocking, isBatchable, isBatchLoadable, isCacheInvalidationRequired, isCollection, isDefinedOnSubclass, isDeleteCallable, isExplicitPolymorphism, isIdentifierAssignedByInsert, isInherited, isInsertCallable, isInstance, isInstrumented, isLazyPropertiesCacheable, isMultiTable, isMutable, isPhysicalDiscriminator, isPolymorphic, isPropertySelectable, isSelectable, isSelectBeforeUpdateRequired, isSharedColumn, isSubclassEntityName, isSubclassPropertyNullable, isSubclassTableIndicatedByTreatAsDeclarations, isSubclassTableSequentialSelect, isTransient, isTypeOrSuperType, isUpdateCallable, isVersioned, isVersionGeneratedBeforeExecution, isVersionGeneratedOnExecution, isVersionPropertyGenerated, isVersionPropertyInsertable, linkToSession, linkWithSubType, linkWithSuperType, load, load, load, loadByUniqueKey, loadByUniqueKey, loadEntityIdByNaturalId, lock, lock, logStaticSQL, multiLoad, optimisticLockStyle, physicalTableNameForMutation, postConstruct, postInstantiate, prepareLoaders, prepareMappingModel, processInsertGeneratedProperties, processUpdateGeneratedProperties, registerAffectingFetchProfile, resetIdentifier, resolveAttributeIndexes, resolveDirtyAttributeIndexes, resolveDiscriminatorType, selectFragment, setIdentifier, setPropertyValue, setPropertyValue, setPropertyValues, shouldGetAllProperties, shouldInnerJoinSubclassTable, shouldProcessSuperMapping, storeDiscriminatorInShallowQueryCacheLayout, substituteBrackets, toColumns, toColumns, toString, toType, uniqueKeyEntries, useShallowQueryCacheLayout, verifyHasNaturalId, visitAttributeMappings, visitDeclaredAttributeMappings, visitFetchables, visitFetchables, visitKeyFetchables, visitKeyFetchables, visitSubParts, visitSubTypeAttributeMappings, visitSuperTypeAttributeMappings

    Methods inherited from class java.lang.Object

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

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

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

    Methods inherited from interface org.hibernate.metadata.ClassMetadata

    getIdentifier, getIdentifier, getPropertyValuesToInsert, instantiate, setIdentifier

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

    asEntityMappingType, extractConcreteTypeStateValues, findContainingEntityMapping, findSubPart, getContributor, getJavaType, getPartMappingType, getRootEntityDescriptor, getRootPathName, getSubclassEntityNames, getSubclassId, isTypeOrSuperType, pruneForSubclasses

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

    getIdentityInsertDelegate, getMutationDelegate

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

    addToCacheKey, breakDownJdbcValues, canExtractIdOutOfEntity, getEntityMappingType, getFilterAliasGenerator, getGeneratedProperties, getSynchronizationSpaces, getSynchronizedQuerySpaces, getValue, getValues, getVersionJavaType, insert, insert, load, merge, processInsertGeneratedProperties, processUpdateGeneratedProperties, setValue, setValues, update, visitQuerySpaces

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

    forEachSubPart

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

    getSelectableIndex, visitFetchables, visitKeyFetchables

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

    getSingleJdbcMapping

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

    isAffectedByInfluencers, isNotAffectedByInfluencers

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

    anyRequiresAggregateColumnWriter

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

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

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

    findByPath, findByPath, forEachSubPart

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

    getRolePath

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

    getAttributeMutationTableName
  • 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.metadata.ClassMetadata
      Specified by:
      instantiate in interface org.hibernate.persister.entity.EntityPersister
      Overrides:
      instantiate in class org.hibernate.persister.entity.AbstractEntityPersister