public class UnionSubclassEntityPersister extends AbstractEntityPersister
Implementation of the "table-per-concrete-class" or "roll-down" mapping strategy for an entity and its inheritence hierarchy.
hasIdentifierPropertyAbstractEntityPersister.CacheEntryHelper, AbstractEntityPersister.InclusionCheckerQueryable.DeclarerLazyPropertyInitializer.InterceptorImplementorbatchSize, customSQLDelete, customSQLInsert, customSQLUpdate, deleteCallable, deleteResultCheckStyles, ENTITY_CLASS, insertCallable, insertResultCheckStyles, propertyMapping, rowIdName, updateCallable, updateResultCheckStylesROWID_ALIASENTITY_IDUNFETCHED_PROPERTY| Constructor and Description |
|---|
UnionSubclassEntityPersister(PersistentClass persistentClass,
EntityDataAccess cacheAccessStrategy,
NaturalIdDataAccess naturalIdRegionAccessStrategy,
PersisterCreationContext creationContext) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addDiscriminatorToSelect(SelectFragment select,
String name,
String suffix) |
String |
filterFragment(String name) |
protected String |
filterFragment(String alias,
Set<String> treatAsDeclarations) |
String |
fromTableFragment(String name)
Get the main from table fragment, given a query alias.
|
protected String |
generateSelectString(LockMode lockMode)
Generate the SQL that selects a row by id
|
protected String |
generateSubquery(PersistentClass model,
Mapping mapping) |
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 in
Queryable.getConstraintOrderedTableNameClosure(), get
the columns that define the key between the various hierarchy classes. |
protected String |
getDiscriminatorFormula() |
String |
getDiscriminatorSQLValue()
Get the discriminator value for this particular concrete subclass,
as a string that may be embedded in a select statement
|
Type |
getDiscriminatorType()
Get the discriminator type
|
Object |
getDiscriminatorValue()
Get the discriminator value
|
org.hibernate.internal.FilterAliasGenerator |
getFilterAliasGenerator(String rootAlias) |
protected 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.
|
String |
getPropertyTableName(String propertyName)
Get the table name for the given property path
|
protected int[] |
getPropertyTableNumbers() |
protected int[] |
getPropertyTableNumbersInSelect() |
Serializable[] |
getQuerySpaces()
Returns an array of objects that identify spaces in which properties of
this entity are persisted, for instances of this class and its subclasses.
|
String[] |
getSubclassClosure() |
protected int[] |
getSubclassColumnTableNumberClosure() |
String |
getSubclassForDiscriminatorValue(Object value)
Get the concrete subclass corresponding to the given discriminator
value
|
protected int[] |
getSubclassFormulaTableNumberClosure() |
String |
getSubclassPropertyTableName(int i)
Return the table name used to persist the numbered property of the
class or a subclass.
|
protected int |
getSubclassPropertyTableNumber(int i) |
int |
getSubclassPropertyTableNumber(String propertyName)
Warning:
When there are duplicated property names in the subclasses
of the class, this method may return the wrong table
number for the duplicated subclass property (note that
SingleTableEntityPersister defines an overloaded form
which takes the entity name.
|
protected String[] |
getSubclassTableKeyColumns(int j) |
String |
getSubclassTableName(int j)
Get the name of the table with the given index from the internal
array.
|
int |
getSubclassTableSpan() |
protected boolean[] |
getTableHasColumns() |
String |
getTableName()
The table to join to.
|
protected String |
getTableName(int j) |
int |
getTableSpan() |
protected boolean |
isClassOrSuperclassTable(int j) |
protected boolean |
isDiscriminatorFormula() |
boolean |
isMultiTable()
Is the inheritance hierarchy described by this persister contained across
multiple tables?
|
protected boolean |
isPropertyOfTable(int property,
int j) |
protected boolean |
isTableCascadeDeleteEnabled(int j) |
addDiscriminatorToInsert, afterInitialize, afterReassociate, buildCacheEntry, buildCacheEntryHelper, canExtractIdOutOfEntity, canReadFromCache, canUseReferenceCacheEntries, canWriteToCache, check, checkVersion, concretePropertySelectFragment, concretePropertySelectFragment, concretePropertySelectFragmentSansLeadingComma, consumesCollectionAlias, consumesEntityAlias, countSubclassProperties, createEntityLoader, createEntityLoader, createEntityLoader, createFrom, createJoin, createJoin, createLoaders, createProxy, createQueryLoader, createSelect, createUniqueKeyLoaders, createWhereByKey, dehydrate, dehydrate, delete, delete, determineSubclassTableJoinType, determineTableName, determineTableNumberForColumn, doPostInstantiate, filterFragment, filterFragment, findDirty, findModified, forceVersionIncrement, fromJoinFragment, fromJoinFragment, generateDeleteString, generateEntityDefinition, generateFilterConditionAlias, generateIdByUniqueKeySelectString, generateIdentityInsertString, generateInsertGeneratedValuesSelectString, generateInsertString, generateInsertString, generateInsertString, generateLazySelectStringsByFetchGroup, generateLocker, generateSelectVersionString, generateSnapshotSelectString, generateTableAlias, generateUpdateGeneratedValuesSelectString, generateUpdateString, generateUpdateString, getAppropriateLoader, getAttributes, getCacheAccessStrategy, getCacheEntryStructure, getCascadeStyle, getClassMetadata, getCollectionKey, getConcreteProxyClass, getCurrentVersion, getDatabaseSnapshot, getDiscriminatorAlias, getDiscriminatorAlias, getDiscriminatorColumnName, getDiscriminatorColumnReaders, getDiscriminatorColumnReaderTemplate, getDiscriminatorFormulaTemplate, getEntityEntryFactory, getEntityKeyDefinition, getEntityMetamodel, getEntityMode, getEntityName, getEntityPersister, getEntityTuplizer, getEntityType, getFactory, getFetchMode, getIdByUniqueKey, getIdentifier, getIdentifier, getIdentifierAliases, getIdentifierAliases, getIdentifierColumnNames, getIdentifierColumnReaders, getIdentifierColumnReaderTemplates, getIdentifierColumnSpan, getIdentifierGenerator, getIdentifierPropertyName, getIdentifierType, getIdentitySelectString, 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, getRootEntityName, getRootTableAlias, getRootTableIdentifierColumnNames, getRootTableKeyColumnNames, getRootTableName, getSelectByUniqueKeyString, getSequentialSelect, 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, getSubclassPropertyType, getSubclassPropertyTypeClosure, getTableAliasForColumn, getTableId, getTableUpdateNeeded, getTemplateFromString, getType, getTypeDiscriminatorMetadata, getVersion, getVersionColumnName, getVersionComparator, getVersionedTableName, getVersionProperty, getVersionSelectString, getVersionType, hasCache, hasCascades, hasCollections, hasEmbeddedCompositeIdentifier, hasFormulaProperties, hasIdentifierProperty, hasInsertGeneratedProperties, hasLazyProperties, hasMutableProperties, hasNaturalIdCache, hasNaturalIdentifier, hasProxy, hasRowId, hasSequentialSelect, hasSubclasses, hasSubselectLoadableCollections, hasUninitializedLazyProperties, hasUpdateGeneratedProperties, hasWhere, hydrate, identifierSelectFragment, implementsLifecycle, initializeLazyProperty, initLockers, initPropertyPaths, initSubclassPropertyAliasesMap, insert, insert, insert, insert, instantiate, isAbstract, isAllNull, isBatchable, isBatchLoadable, isCacheInvalidationRequired, isCollection, isDefinedOnSubclass, isDeleteCallable, isExplicitPolymorphism, isIdentifierAssignedByInsert, isInherited, isInsertCallable, isInstance, isInstrumented, isInverseSubclassTable, isInverseTable, isLazyPropertiesCacheable, isModifiableEntity, isMutable, isNaturalIdNonNullable, isNullableSubclassTable, isNullableTable, isPolymorphic, isSelectBeforeUpdateRequired, isSubclassEntityName, isSubclassPropertyDeferred, isSubclassPropertyNullable, isSubclassTableIndicatedByTreatAsDeclarations, isSubclassTableLazy, isSubclassTableSequentialSelect, isTransient, isUpdateCallable, isVersioned, isVersionPropertyGenerated, isVersionPropertyInsertable, load, load, loadByUniqueKey, loadEntityIdByNaturalId, lock, lock, logStaticSQL, multiLoad, oneToManyFilterFragment, oneToManyFilterFragment, 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, whereJoinFragmentclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetIdentifier, getPropertyValuesToInsert, instantiate, setIdentifierpublic UnionSubclassEntityPersister(PersistentClass persistentClass, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy, PersisterCreationContext creationContext) throws HibernateException
HibernateExceptionpublic Serializable[] getQuerySpaces()
EntityPersisterReturns an array of objects that identify spaces in which properties of
this entity are persisted, for instances of this class and its subclasses.
<p/>
Much like EntityPersister.getPropertySpaces(), except that here we include subclass
entity spaces.
getQuerySpaces in interface EntityPersistergetQuerySpaces in class AbstractEntityPersisterpublic String getTableName()
JoinableThe table to join to.
public Type getDiscriminatorType()
LoadableGet the discriminator type
public Object getDiscriminatorValue()
LoadableGet the discriminator value
public String getDiscriminatorSQLValue()
QueryableGet the discriminator value for this particular concrete subclass, as a string that may be embedded in a select statement
public String[] getSubclassClosure()
public String getSubclassForDiscriminatorValue(Object value)
LoadableGet the concrete subclass corresponding to the given discriminator value
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. <p/> 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).
protected boolean isDiscriminatorFormula()
protected String generateSelectString(LockMode lockMode)
Generate the SQL that selects a row by id
protected String getDiscriminatorFormula()
protected String getTableName(int j)
getTableName in class AbstractEntityPersisterprotected String[] getKeyColumns(int j)
getKeyColumns in class AbstractEntityPersisterprotected boolean isTableCascadeDeleteEnabled(int j)
isTableCascadeDeleteEnabled in class AbstractEntityPersisterprotected boolean isPropertyOfTable(int property,
int j)
isPropertyOfTable in class AbstractEntityPersisterpublic String fromTableFragment(String name)
OuterJoinLoadableGet the main from table fragment, given a query alias.
public String filterFragment(String name)
filterFragment in class AbstractEntityPersisterprotected String filterFragment(String alias, Set<String> treatAsDeclarations)
filterFragment in class AbstractEntityPersisterpublic String getSubclassPropertyTableName(int i)
OuterJoinLoadableReturn the table name used to persist the numbered property of the class or a subclass.
protected void addDiscriminatorToSelect(SelectFragment select, String name, String suffix)
addDiscriminatorToSelect in class AbstractEntityPersisterprotected int[] getPropertyTableNumbersInSelect()
getPropertyTableNumbersInSelect in class AbstractEntityPersisterprotected int getSubclassPropertyTableNumber(int i)
getSubclassPropertyTableNumber in class AbstractEntityPersisterpublic int getSubclassPropertyTableNumber(String propertyName)
AbstractEntityPersisterWarning: When there are duplicated property names in the subclasses of the class, this method may return the wrong table number for the duplicated subclass property (note that SingleTableEntityPersister defines an overloaded form which takes the entity name.
getSubclassPropertyTableNumber in interface QueryablegetSubclassPropertyTableNumber in class AbstractEntityPersisterpropertyName - The name of the property.public boolean isMultiTable()
QueryableIs the inheritance hierarchy described by this persister contained across multiple tables?
isMultiTable in interface QueryableisMultiTable in class AbstractEntityPersisterpublic int getTableSpan()
getTableSpan in class AbstractEntityPersisterprotected int[] getSubclassColumnTableNumberClosure()
getSubclassColumnTableNumberClosure in class AbstractEntityPersisterprotected int[] getSubclassFormulaTableNumberClosure()
getSubclassFormulaTableNumberClosure in class AbstractEntityPersisterprotected boolean[] getTableHasColumns()
protected int[] getPropertyTableNumbers()
getPropertyTableNumbers in class AbstractEntityPersisterprotected String generateSubquery(PersistentClass model, Mapping mapping)
protected String[] getSubclassTableKeyColumns(int j)
getSubclassTableKeyColumns in class AbstractEntityPersisterpublic String getSubclassTableName(int j)
QueryableGet the name of the table with the given index from the internal array.
getSubclassTableName in interface QueryablegetSubclassTableName in class AbstractEntityPersisterj - The index into the internal array.public int getSubclassTableSpan()
getSubclassTableSpan in class AbstractEntityPersisterprotected boolean isClassOrSuperclassTable(int j)
isClassOrSuperclassTable in class AbstractEntityPersisterpublic String getPropertyTableName(String propertyName)
OuterJoinLoadableGet the table name for the given property path
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.
public String[][] getContraintOrderedTableKeyColumnClosure()
QueryableFor each table specified in Queryable.getConstraintOrderedTableNameClosure(), get
the columns that define the key between the various hierarchy classes.
<p/>
The first dimension here corresponds to the table indexes returned in
Queryable.getConstraintOrderedTableNameClosure().
<p/>
The second dimension should have the same length across all the elements in
the first dimension. If not, that would be a problem ;)
public org.hibernate.internal.FilterAliasGenerator getFilterAliasGenerator(String rootAlias)
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.