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.id.PostInsertIdentityPersister, org.hibernate.metadata.ClassMetadata, org.hibernate.persister.entity.EntityPersister, org.hibernate.persister.entity.Joinable, org.hibernate.persister.entity.Loadable, org.hibernate.persister.entity.Lockable, 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.persister.walking.spi.EntityDefinition

public class CustomEntityPersister extends org.hibernate.persister.entity.SingleTableEntityPersister
An EntityPersister implementation with some custom functionality. This persister lazily initializes its EntityLoader. By default an EntityLoader instance is created for each LockMode. However most loaders are never used and therefore we initialize them lazily as they use quite a lot of memory.
  • 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.InclusionChecker

    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.persister.entity.Queryable

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

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

    batchSize, customSQLDelete, customSQLInsert, customSQLUpdate, deleteCallable, deleteResultCheckStyles, ENTITY_CLASS, insertCallable, insertResultCheckStyles, propertyMapping, rowIdName, updateCallable, updateResultCheckStyles, 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.persister.spi.PersisterCreationContext creationContext)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.hibernate.loader.entity.UniqueEntityLoader
    createEntityLoader(org.hibernate.LockMode lockMode)
     
    instantiate(Serializable id, org.hibernate.engine.spi.SharedSessionContractImplementor session)
    Verifies that the entity being instantiated belongs to the current session.
    void
     
    void
     

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

    addDiscriminatorToInsert, addDiscriminatorToSelect, canOmitSuperclassTableJoin, doPostInstantiate, filterFragment, filterFragment, fromTableFragment, getConstraintOrderedTableNameClosure, getContraintOrderedTableKeyColumnClosure, getDiscriminatorAlias, getDiscriminatorColumnName, getDiscriminatorColumnReaders, getDiscriminatorColumnReaderTemplate, getDiscriminatorFormula, getDiscriminatorFormulaTemplate, getDiscriminatorSQLValue, getDiscriminatorType, getDiscriminatorValue, getFilterAliasGenerator, getKeyColumns, getPropertySpaces, getPropertyTableName, getPropertyTableNumbers, getPropertyTableNumbersInSelect, getSequentialSelect, getSubclassClosure, getSubclassColumnTableNumberClosure, getSubclassForDiscriminatorValue, getSubclassFormulaTableNumberClosure, getSubclassPropertyTableName, getSubclassPropertyTableNumber, getSubclassTableKeyColumns, getSubclassTableName, getSubclassTableSpan, getTableName, getTableName, getTableSpan, hasSequentialSelect, isClassOrSuperclassJoin, isClassOrSuperclassTable, isDiscriminatorFormula, isInverseSubclassTable, isInverseTable, isMultiTable, isNullableSubclassTable, isNullableTable, isPropertyOfTable, isSubclassPropertyDeferred, isSubclassTableLazy, isSubclassTableSequentialSelect, isTableCascadeDeleteEnabled, oneToManyFilterFragment, oneToManyFilterFragment

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

    afterInitialize, afterReassociate, buildCacheEntry, buildCacheEntryHelper, buildMergeCascadeEntityLoader, buildRefreshCascadeEntityLoader, canExtractIdOutOfEntity, canReadFromCache, canUseReferenceCacheEntries, canWriteToCache, check, checkVersion, concretePropertySelectFragment, concretePropertySelectFragment, concretePropertySelectFragmentSansLeadingComma, consumesCollectionAlias, consumesEntityAlias, countSubclassProperties, createDelete, createEntityLoader, createEntityLoader, createFrom, createInsert, createJoin, createJoin, createJoin, createLoaders, createNaturalIdLoaders, createProxy, createQueryLoader, createSelect, createUniqueKeyLoader, createUniqueKeyLoaders, createUpdate, createWhereByKey, dehydrate, dehydrate, delete, delete, determinePkByNaturalIdQuery, determineSubclassTableJoinType, determineSubclassTableJoinType, determineTableName, determineTableNumberForColumn, determineValueNullness, filterFragment, filterFragment, findDirty, findModified, forceVersionIncrement, fromJoinFragment, fromJoinFragment, fromJoinFragment, generateDeleteString, generateEntityDefinition, generateFilterConditionAlias, generateIdByUniqueKeySelectString, generateIdentityInsertString, generateInsertGeneratedValuesSelectString, generateInsertString, generateInsertString, generateInsertString, generateLazySelectStringsByFetchGroup, generateLocker, generateSelectVersionString, generateSnapshotSelectString, generateSQLDeleteStrings, generateTableAlias, generateUpdateGeneratedValuesSelectString, generateUpdateString, generateUpdateString, getAppropriateLoader, getAppropriateUniqueKeyLoader, getAttributes, getBytecodeEnhancementMetadata, getCacheAccessStrategy, getCacheEntryStructure, getCascadeStyle, getClassMetadata, getCollectionKey, getConcreteProxyClass, getCurrentVersion, getDatabaseSnapshot, getDeleteResultCheckStyles, getDiscriminatorAlias, getEntityEntryFactory, getEntityKeyDefinition, getEntityMetamodel, getEntityMode, getEntityName, getEntityPersister, getEntityTuplizer, getEntityType, getFactory, getFetchMode, getIdByUniqueKey, getIdentifier, getIdentifier, getIdentifierAliases, getIdentifierAliases, getIdentifierColumnNames, getIdentifierColumnReaders, getIdentifierColumnReaderTemplates, getIdentifierColumnSpan, getIdentifierGenerator, getIdentifierPropertyName, getIdentifierType, getIdentityDelegate, getIdentitySelectString, getInsertResultCheckStyles, getInstrumentationMetadata, getKeyColumnNames, getLazyPropertyColumnAliases, getLazyPropertyNames, getLazyPropertyNumbers, getLazyPropertyTypes, getLoaderByLockMode, getMappedClass, getMappedSuperclass, getName, getNaturalIdCacheAccessStrategy, getNaturalIdentifierProperties, getNaturalIdentifierSnapshot, getNavigableRole, getNonLazyPropertyUpdateability, getPolymorphicJoinColumns, getPropertiesToInsert, getPropertiesToUpdate, getPropertyAliases, getPropertyCascadeStyles, getPropertyCheckability, getPropertyColumnInsertable, getPropertyColumnNames, getPropertyColumnNames, getPropertyColumnSpan, getPropertyColumnUpdateable, getPropertyColumnWriters, getPropertyIndex, getPropertyInsertability, getPropertyInsertGenerationInclusions, getPropertyLaziness, getPropertyNames, getPropertyNullability, getPropertySelectable, getPropertySpan, getPropertySubclassNames, getPropertyType, getPropertyTypes, getPropertyUniqueness, getPropertyUpdateability, getPropertyUpdateability, getPropertyUpdateGenerationInclusions, getPropertyValue, getPropertyValue, getPropertyValues, getPropertyValuesToInsert, getPropertyVersionability, getQuerySpaces, getRootEntityName, getRootTableAlias, getRootTableIdentifierColumnNames, getRootTableKeyColumnNames, getRootTableName, getSelectByUniqueKeyString, getSQLDeleteStrings, getSQLIdentityInsertString, getSQLInsertStrings, getSQLLazySelectString, getSQLLazyUpdateByRowIdStrings, getSQLLazyUpdateStrings, getSQLSnapshotSelectString, getSQLUpdateByRowIdStrings, getSQLUpdateStrings, getSQLWhereString, getSubclassColumnAliasClosure, getSubclassColumnClosure, getSubclassColumnLazyiness, getSubclassColumnReaderTemplateClosure, getSubclassEntityPersister, getSubclassFormulaAliasClosure, getSubclassFormulaClosure, getSubclassFormulaLazyiness, getSubclassFormulaTemplateClosure, getSubclassPropertyColumnAliases, getSubclassPropertyColumnNameClosure, getSubclassPropertyColumnNames, getSubclassPropertyColumnNames, getSubclassPropertyColumnReaderClosure, getSubclassPropertyColumnReaderTemplateClosure, getSubclassPropertyDeclarer, getSubclassPropertyFormulaTemplateClosure, getSubclassPropertyName, getSubclassPropertyNameClosure, getSubclassPropertySubclassNameClosure, getSubclassPropertyTableNumber, getSubclassPropertyType, getSubclassPropertyTypeClosure, getTableAliasForColumn, getTableId, getTableNames, getTableUpdateNeeded, getTemplateFromString, getType, getTypeDiscriminatorMetadata, getUpdateResultCheckStyles, getUpdateStrings, getVersion, getVersionColumnName, getVersionComparator, getVersionedTableName, getVersionProperty, getVersionSelectString, getVersionType, hasCache, hasCascades, hasCollections, hasEmbeddedCompositeIdentifier, hasFormulaProperties, hasIdentifierProperty, hasInsertGeneratedProperties, hasLazyProperties, hasMutableProperties, hasNaturalIdCache, hasNaturalIdentifier, hasProxy, hasRowId, hasSubclasses, hasSubselectLoadableCollections, hasUninitializedLazyProperties, hasUpdateGeneratedProperties, hasWhere, hydrate, identifierSelectFragment, implementsLifecycle, initializeEnhancedEntityUsedAsProxy, initializeLazyPropertiesFromCache, initializeLazyPropertiesFromDatastore, initializeLazyProperty, initializeLazyProperty, initPropertyPaths, initSubclassPropertyAliasesMap, insert, insert, insert, insert, isAbstract, isAllNull, isAllOrDirtyOptLocking, isBatchable, isBatchLoadable, isCacheInvalidationRequired, isCollection, isDefinedOnSubclass, isDeleteCallable, isExplicitPolymorphism, isIdentifierAssignedByInsert, isInherited, isInsertCallable, isInstance, isInstrumented, isLazyPropertiesCacheable, isModifiableEntity, isMutable, isNaturalIdNonNullable, isPolymorphic, isSelectBeforeUpdateRequired, isSubclassEntityName, isSubclassPropertyNullable, isSubclassTableIndicatedByTreatAsDeclarations, isTransient, isUpdateCallable, isValueGenerationRequired, isVersioned, isVersionPropertyGenerated, isVersionPropertyInsertable, load, load, load, loadByNaturalId, loadByUniqueKey, loadEntityIdByNaturalId, lock, lock, logStaticSQL, multiLoad, optimisticLockStyle, postConstruct, postInstantiate, preInsertInMemoryValueGeneration, processInsertGeneratedProperties, processUpdateGeneratedProperties, propertySelectFragment, propertySelectFragmentFragment, registerAffectingFetchProfile, renderSelect, resetIdentifier, resolveAttributeIndexes, resolveDirtyAttributeIndexes, selectFragment, selectFragment, setIdentifier, setPropertyValue, setPropertyValue, setPropertyValues, toColumns, toColumns, toColumns, toString, toType, update, update, updateOrInsert, useDynamicInsert, useDynamicUpdate, useGetGeneratedKeys, useInsertSelectIdentity, whereJoinFragment, whereJoinFragment

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.hibernate.metadata.ClassMetadata

    getIdentifier, getPropertyValuesToInsert, instantiate, setIdentifier

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

    canIdentityInsertBeDelayed, load

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

    hydrate
  • 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.persister.spi.PersisterCreationContext creationContext) throws org.hibernate.HibernateException
      Throws:
      org.hibernate.HibernateException
  • Method Details

    • setDataModel

      public void setDataModel(DataModel dataModel)
    • setEntityFactory

      public void setEntityFactory(EntityFactory entityFactory)
    • createEntityLoader

      protected org.hibernate.loader.entity.UniqueEntityLoader createEntityLoader(org.hibernate.LockMode lockMode) throws org.hibernate.MappingException
      Overrides:
      createEntityLoader in class org.hibernate.persister.entity.AbstractEntityPersister
      Throws:
      org.hibernate.MappingException
    • instantiate

      public Object instantiate(Serializable 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