类 SingleTableEntityPersister
- java.lang.Object
-
- org.hibernate.persister.entity.AbstractEntityPersister
-
- org.hibernate.persister.entity.SingleTableEntityPersister
-
- 所有已实现的接口:
LazyPropertyInitializer,PostInsertIdentityPersister,ClassMetadata,EntityPersister,Joinable,Loadable,Lockable,OuterJoinLoadable,PropertyMapping,Queryable,SQLLoadable,UniqueKeyLoadable,AttributeSource,EntityDefinition
public class SingleTableEntityPersister extends AbstractEntityPersister
The default implementation of the EntityPersister interface. Implements the "table-per-class-hierarchy" or "roll-up" mapping strategy for an entity class and its inheritance hierarchy. This is implemented as a single table holding all classes in the hierarchy with a discriminator column used to determine which concrete class is referenced.- 作者:
- Gavin King
-
-
嵌套类概要
-
从类继承的嵌套类/接口 org.hibernate.persister.entity.AbstractEntityPersister
AbstractEntityPersister.CacheEntryHelper, AbstractEntityPersister.InclusionChecker
-
从接口继承的嵌套类/接口 org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer
LazyPropertyInitializer.InterceptorImplementor
-
从接口继承的嵌套类/接口 org.hibernate.persister.entity.Queryable
Queryable.Declarer
-
-
字段概要
-
从类继承的字段 org.hibernate.persister.entity.AbstractEntityPersister
batchSize, customSQLDelete, customSQLInsert, customSQLUpdate, deleteCallable, deleteResultCheckStyles, ENTITY_CLASS, insertCallable, insertResultCheckStyles, propertyMapping, rowIdName, updateCallable, updateResultCheckStyles
-
从接口继承的字段 org.hibernate.persister.entity.EntityPersister
ENTITY_ID
-
从接口继承的字段 org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer
UNFETCHED_PROPERTY
-
从接口继承的字段 org.hibernate.persister.entity.Loadable
ROWID_ALIAS
-
-
构造器概要
构造器 构造器 说明 SingleTableEntityPersister(PersistentClass persistentClass, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy, PersisterCreationContext creationContext)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected voidaddDiscriminatorToInsert(Insert insert)protected voidaddDiscriminatorToSelect(SelectFragment select, String name, String suffix)booleancanOmitSuperclassTableJoin()If true, persister can omit superclass tables during joining if they are not needed in the query.protected voiddoPostInstantiate()protected StringfilterFragment(String alias)protected StringfilterFragment(String alias, Set<String> treatAsDeclarations)StringfromTableFragment(String name)Get the main from table fragment, given a query alias.String[]getConstraintOrderedTableNameClosure()Get the names of all tables used in the hierarchy (up and down) ordered such that deletes in the given order would not cause constraint violations.String[][]getContraintOrderedTableKeyColumnClosure()For each table specified inQueryable.getConstraintOrderedTableNameClosure(), get the columns that define the key between the various hierarchy classes.StringgetDiscriminatorAlias()StringgetDiscriminatorColumnName()StringgetDiscriminatorColumnReaders()StringgetDiscriminatorColumnReaderTemplate()protected StringgetDiscriminatorFormula()StringgetDiscriminatorFormulaTemplate()StringgetDiscriminatorSQLValue()Get the discriminator value for this particular concrete subclass, as a string that may be embedded in a select statementTypegetDiscriminatorType()Get the discriminator typeObjectgetDiscriminatorValue()Get the discriminator valueFilterAliasGeneratorgetFilterAliasGenerator(String rootAlias)String[]getKeyColumns(int j)Serializable[]getPropertySpaces()Returns an array of objects that identify spaces in which properties of this entity are persisted, for instances of this class only.StringgetPropertyTableName(String propertyName)Get the table name for the given property pathprotected int[]getPropertyTableNumbers()protected int[]getPropertyTableNumbersInSelect()protected StringgetSequentialSelect(String entityName)String[]getSubclassClosure()protected int[]getSubclassColumnTableNumberClosure()StringgetSubclassForDiscriminatorValue(Object value)Get the concrete subclass corresponding to the given discriminator valueprotected int[]getSubclassFormulaTableNumberClosure()StringgetSubclassPropertyTableName(int i)Return the table name used to persist the numbered property of the class or a subclass.protected intgetSubclassPropertyTableNumber(int i)protected String[]getSubclassTableKeyColumns(int j)StringgetSubclassTableName(int j)Get the name of the table with the given index from the internal array.intgetSubclassTableSpan()StringgetTableName()The table to join to.StringgetTableName(int j)intgetTableSpan()booleanhasSequentialSelect()protected booleanisClassOrSuperclassJoin(int j)protected booleanisClassOrSuperclassTable(int j)protected booleanisDiscriminatorFormula()protected booleanisInverseSubclassTable(int j)booleanisInverseTable(int j)booleanisMultiTable()Is the inheritance hierarchy described by this persister contained across multiple tables?protected booleanisNullableSubclassTable(int j)booleanisNullableTable(int j)booleanisPropertyOfTable(int property, int j)protected booleanisSubclassPropertyDeferred(String propertyName, String entityName)protected booleanisSubclassTableLazy(int j)protected booleanisSubclassTableSequentialSelect(int j)booleanisTableCascadeDeleteEnabled(int j)StringoneToManyFilterFragment(String alias)StringoneToManyFilterFragment(String alias, Set<String> treatAsDeclarations)-
从类继承的方法 org.hibernate.persister.entity.AbstractEntityPersister
afterInitialize, afterReassociate, buildCacheEntry, buildCacheEntryHelper, canExtractIdOutOfEntity, canReadFromCache, canUseReferenceCacheEntries, canWriteToCache, check, checkVersion, concretePropertySelectFragment, concretePropertySelectFragment, concretePropertySelectFragmentSansLeadingComma, consumesCollectionAlias, consumesEntityAlias, countSubclassProperties, createDelete, createEntityLoader, createEntityLoader, createEntityLoader, createFrom, createInsert, createJoin, createJoin, createJoin, createLoaders, createProxy, createQueryLoader, createSelect, createUniqueKeyLoaders, createUpdate, createWhereByKey, dehydrate, dehydrate, delete, delete, determineSubclassTableJoinType, determineSubclassTableJoinType, determineTableName, determineTableNumberForColumn, filterFragment, filterFragment, findDirty, findModified, forceVersionIncrement, fromJoinFragment, fromJoinFragment, fromJoinFragment, generateDeleteString, generateEntityDefinition, generateFilterConditionAlias, generateIdByUniqueKeySelectString, generateIdentityInsertString, generateInsertGeneratedValuesSelectString, generateInsertString, generateInsertString, generateInsertString, generateLazySelectStringsByFetchGroup, generateLocker, generateSelectVersionString, generateSnapshotSelectString, generateTableAlias, generateUpdateGeneratedValuesSelectString, generateUpdateString, generateUpdateString, getAppropriateLoader, 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, getIdentitySelectString, getInsertResultCheckStyles, getInstrumentationMetadata, getKeyColumnNames, getLoaderByLockMode, getLoaders, 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, 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, initializeLazyProperty, initLockers, initPropertyPaths, initSubclassPropertyAliasesMap, insert, insert, insert, insert, instantiate, isAbstract, isAllNull, isBatchable, isBatchLoadable, isCacheInvalidationRequired, isCollection, isDefinedOnSubclass, isDeleteCallable, isExplicitPolymorphism, isIdentifierAssignedByInsert, isInherited, isInsertCallable, isInstance, isInstrumented, isLazyPropertiesCacheable, isModifiableEntity, isMutable, isNaturalIdNonNullable, isPolymorphic, isSelectBeforeUpdateRequired, isSubclassEntityName, isSubclassPropertyNullable, isSubclassTableIndicatedByTreatAsDeclarations, isTransient, isUpdateCallable, isVersioned, isVersionPropertyGenerated, isVersionPropertyInsertable, load, load, load, loadByUniqueKey, loadEntityIdByNaturalId, lock, lock, logStaticSQL, multiLoad, optimisticLockStyle, postConstruct, postInstantiate, processInsertGeneratedProperties, processUpdateGeneratedProperties, propertySelectFragment, propertySelectFragmentFragment, registerAffectingFetchProfile, renderSelect, resetIdentifier, resolveAttributeIndexes, selectFragment, selectFragment, setIdentifier, setPropertyValue, setPropertyValue, setPropertyValues, toColumns, toColumns, toColumns, toString, toType, update, update, updateOrInsert, useDynamicInsert, useDynamicUpdate, useGetGeneratedKeys, useInsertSelectIdentity, whereJoinFragment, whereJoinFragment
-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
从接口继承的方法 org.hibernate.metadata.ClassMetadata
getIdentifier, getPropertyValuesToInsert, instantiate, setIdentifier
-
从接口继承的方法 org.hibernate.persister.entity.EntityPersister
canIdentityInsertBeDelayed, load
-
-
-
-
构造器详细资料
-
SingleTableEntityPersister
public SingleTableEntityPersister(PersistentClass persistentClass, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy, PersisterCreationContext creationContext) throws HibernateException
-
-
方法详细资料
-
isInverseTable
public boolean isInverseTable(int j)
-
isInverseSubclassTable
protected boolean isInverseSubclassTable(int j)
-
getDiscriminatorColumnName
public String getDiscriminatorColumnName()
- 指定者:
getDiscriminatorColumnName在接口中Loadable- 覆盖:
getDiscriminatorColumnName在类中AbstractEntityPersister- 返回:
- the column name for the discriminator as specified in the mapping.
-
getDiscriminatorColumnReaders
public String getDiscriminatorColumnReaders()
-
getDiscriminatorColumnReaderTemplate
public String getDiscriminatorColumnReaderTemplate()
-
getDiscriminatorAlias
public String getDiscriminatorAlias()
-
getDiscriminatorFormulaTemplate
public String getDiscriminatorFormulaTemplate()
-
getDiscriminatorType
public Type getDiscriminatorType()
从接口复制的说明:LoadableGet the discriminator type
-
getDiscriminatorValue
public Object getDiscriminatorValue()
从接口复制的说明:LoadableGet the discriminator value
-
getDiscriminatorSQLValue
public String getDiscriminatorSQLValue()
从接口复制的说明:QueryableGet the discriminator value for this particular concrete subclass, as a string that may be embedded in a select statement
-
getSubclassClosure
public String[] getSubclassClosure()
-
getSubclassForDiscriminatorValue
public String getSubclassForDiscriminatorValue(Object value)
从接口复制的说明:LoadableGet the concrete subclass corresponding to the given discriminator value
-
getPropertySpaces
public Serializable[] getPropertySpaces()
从接口复制的说明:EntityPersisterReturns an array of objects that identify spaces in which properties of this entity are persisted, for instances of this class only. For most implementations, this returns the complete set of table names to which instances of the mapped entity are persisted (not accounting for superclass entity mappings).- 返回:
- The property spaces.
-
isDiscriminatorFormula
protected boolean isDiscriminatorFormula()
-
getDiscriminatorFormula
protected String getDiscriminatorFormula()
-
getTableName
public String getTableName(int j)
- 指定者:
getTableName在类中AbstractEntityPersister
-
getKeyColumns
public String[] getKeyColumns(int j)
- 指定者:
getKeyColumns在类中AbstractEntityPersister
-
isTableCascadeDeleteEnabled
public boolean isTableCascadeDeleteEnabled(int j)
-
isPropertyOfTable
public boolean isPropertyOfTable(int property, int j)- 指定者:
isPropertyOfTable在类中AbstractEntityPersister
-
isSubclassTableSequentialSelect
protected boolean isSubclassTableSequentialSelect(int j)
-
fromTableFragment
public String fromTableFragment(String name)
从接口复制的说明:OuterJoinLoadableGet the main from table fragment, given a query alias.
-
filterFragment
protected String filterFragment(String alias) throws MappingException
- 指定者:
filterFragment在类中AbstractEntityPersister- 抛出:
MappingException
-
oneToManyFilterFragment
public String oneToManyFilterFragment(String alias) throws MappingException
- 指定者:
oneToManyFilterFragment在接口中Joinable- 覆盖:
oneToManyFilterFragment在类中AbstractEntityPersister- 抛出:
MappingException
-
oneToManyFilterFragment
public String oneToManyFilterFragment(String alias, Set<String> treatAsDeclarations)
- 指定者:
oneToManyFilterFragment在接口中Joinable- 覆盖:
oneToManyFilterFragment在类中AbstractEntityPersister
-
filterFragment
protected String filterFragment(String alias, Set<String> treatAsDeclarations)
- 指定者:
filterFragment在类中AbstractEntityPersister
-
getSubclassPropertyTableName
public String getSubclassPropertyTableName(int i)
从接口复制的说明:OuterJoinLoadableReturn the table name used to persist the numbered property of the class or a subclass.
-
addDiscriminatorToSelect
protected void addDiscriminatorToSelect(SelectFragment select, String name, String suffix)
-
getPropertyTableNumbersInSelect
protected int[] getPropertyTableNumbersInSelect()
-
getSubclassPropertyTableNumber
protected int getSubclassPropertyTableNumber(int i)
-
getTableSpan
public int getTableSpan()
- 指定者:
getTableSpan在类中AbstractEntityPersister
-
addDiscriminatorToInsert
protected void addDiscriminatorToInsert(Insert insert)
-
getSubclassColumnTableNumberClosure
protected int[] getSubclassColumnTableNumberClosure()
-
getSubclassFormulaTableNumberClosure
protected int[] getSubclassFormulaTableNumberClosure()
-
getPropertyTableNumbers
protected int[] getPropertyTableNumbers()
-
isSubclassPropertyDeferred
protected boolean isSubclassPropertyDeferred(String propertyName, String entityName)
-
hasSequentialSelect
public boolean hasSequentialSelect()
-
getSubclassTableKeyColumns
protected String[] getSubclassTableKeyColumns(int j)
-
getSubclassTableName
public String getSubclassTableName(int j)
从接口复制的说明:QueryableGet the name of the table with the given index from the internal array.- 指定者:
getSubclassTableName在接口中Queryable- 指定者:
getSubclassTableName在类中AbstractEntityPersister- 参数:
j- The index into the internal array.
-
getSubclassTableSpan
public int getSubclassTableSpan()
-
isClassOrSuperclassTable
protected boolean isClassOrSuperclassTable(int j)
-
isClassOrSuperclassJoin
protected boolean isClassOrSuperclassJoin(int j)
-
isSubclassTableLazy
protected boolean isSubclassTableLazy(int j)
-
isNullableTable
public boolean isNullableTable(int j)
-
isNullableSubclassTable
protected boolean isNullableSubclassTable(int j)
-
getPropertyTableName
public String getPropertyTableName(String propertyName)
从接口复制的说明:OuterJoinLoadableGet the table name for the given property path
-
doPostInstantiate
protected void doPostInstantiate()
-
canOmitSuperclassTableJoin
public boolean canOmitSuperclassTableJoin()
从类复制的说明:AbstractEntityPersisterIf true, persister can omit superclass tables during joining if they are not needed in the query.- 覆盖:
canOmitSuperclassTableJoin在类中AbstractEntityPersister- 返回:
- true if the persister can do it
-
isMultiTable
public boolean isMultiTable()
从接口复制的说明:QueryableIs the inheritance hierarchy described by this persister contained across multiple tables?- 指定者:
isMultiTable在接口中Queryable- 覆盖:
isMultiTable在类中AbstractEntityPersister- 返回:
- True if the inheritance hierarchy is spread across multiple tables; false otherwise.
-
getConstraintOrderedTableNameClosure
public String[] getConstraintOrderedTableNameClosure()
从接口复制的说明:QueryableGet the names of all tables used in the hierarchy (up and down) ordered such that deletes in the given order would not cause constraint violations.- 返回:
- The ordered array of table names.
-
getContraintOrderedTableKeyColumnClosure
public String[][] getContraintOrderedTableKeyColumnClosure()
从接口复制的说明:QueryableFor each table specified inQueryable.getConstraintOrderedTableNameClosure(), get the columns that define the key between the various hierarchy classes. The first dimension here corresponds to the table indexes returned inQueryable.getConstraintOrderedTableNameClosure(). The second dimension should have the same length across all the elements in the first dimension. If not, that would be a problem ;)
-
getFilterAliasGenerator
public FilterAliasGenerator getFilterAliasGenerator(String rootAlias)
-
-