public class JoinedSubclassEntityPersister extends AbstractEntityPersister
An <tt>EntityPersister</tt> implementing the normalized "table-per-subclass" mapping strategy
hasIdentifierProperty
AbstractEntityPersister.CacheEntryHelper, AbstractEntityPersister.InclusionChecker
Queryable.Declarer
LazyPropertyInitializer.InterceptorImplementor
batchSize, customSQLDelete, customSQLInsert, customSQLUpdate, deleteCallable, deleteResultCheckStyles, ENTITY_CLASS, insertCallable, insertResultCheckStyles, propertyMapping, rowIdName, updateCallable, updateResultCheckStyles
ROWID_ALIAS
ENTITY_ID
UNFETCHED_PROPERTY
Constructor and Description |
---|
JoinedSubclassEntityPersister(PersistentClass persistentClass,
EntityDataAccess cacheAccessStrategy,
NaturalIdDataAccess naturalIdRegionAccessStrategy,
PersisterCreationContext creationContext) |
Modifier and Type | Method and Description |
---|---|
protected void |
addDiscriminatorToInsert(Insert insert) |
void |
addDiscriminatorToSelect(SelectFragment select,
String name,
String suffix) |
int |
determineTableNumberForColumn(String columnName) |
String |
filterFragment(String alias) |
String |
filterFragment(String alias,
Set<String> treatAsDeclarations) |
String |
fromTableFragment(String alias)
Get the main from table fragment, given a query alias.
|
String |
generateFilterConditionAlias(String rootAlias)
The alias used for any filter conditions (mapped where-fragments or
enabled-filters).
|
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 |
getDiscriminatorAlias() |
String |
getDiscriminatorColumnName() |
String |
getDiscriminatorColumnReaders() |
String |
getDiscriminatorColumnReaderTemplate() |
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) |
String[] |
getIdentifierColumnNames()
Get the names of columns used to persist the identifier
|
String[] |
getIdentifierColumnReaders() |
String[] |
getIdentifierColumnReaderTemplates() |
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() |
String |
getRootTableAlias(String drivingAlias)
Get the SQL alias this persister would use for the root table
given the passed driving alias.
|
String |
getRootTableName()
Locks are always applied to the "root table".
|
protected int[] |
getSubclassColumnTableNumberClosure() |
String |
getSubclassForDiscriminatorValue(Object value)
Get the concrete subclass corresponding to the given discriminator
value
|
protected int[] |
getSubclassFormulaTableNumberClosure() |
Queryable.Declarer |
getSubclassPropertyDeclarer(String propertyPath)
Determine whether the given property is declared by our
mapped class, our super class, or one of our subclasses…
<p/>
Note: the method is called 'subclass property…' simply
for consistency sake (e.g.
|
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) |
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() |
String |
getTableName()
The table to join to.
|
protected String |
getTableName(int j) |
int |
getTableSpan() |
protected boolean |
isClassOrSuperclassTable(int j) |
boolean |
isMultiTable()
Is the inheritance hierarchy described by this persister contained across
multiple tables?
|
protected boolean |
isNullableTable(int j) |
protected boolean |
isPropertyOfTable(int property,
int j) |
protected boolean |
isSubclassTableIndicatedByTreatAsDeclarations(int subclassTableNumber,
Set<String> treatAsDeclarations) |
protected boolean |
isSubclassTableLazy(int j) |
protected boolean |
isSubclassTableSequentialSelect(int j) |
protected boolean |
isTableCascadeDeleteEnabled(int j) |
String[] |
toColumns(String alias,
String propertyName)
Obtain aliased column/formula fragments for the specified property path.
|
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, doPostInstantiate, filterFragment, filterFragment, findDirty, findModified, forceVersionIncrement, fromJoinFragment, fromJoinFragment, generateDeleteString, generateEntityDefinition, 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, getDiscriminatorFormulaTemplate, getEntityEntryFactory, getEntityKeyDefinition, getEntityMetamodel, getEntityMode, getEntityName, getEntityPersister, getEntityTuplizer, getEntityType, getFactory, getFetchMode, getIdByUniqueKey, getIdentifier, getIdentifier, getIdentifierAliases, getIdentifierAliases, 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, getQuerySpaces, getRootEntityName, getRootTableIdentifierColumnNames, getRootTableKeyColumnNames, 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, getSubclassPropertyFormulaTemplateClosure, getSubclassPropertyName, getSubclassPropertyNameClosure, getSubclassPropertySubclassNameClosure, getSubclassPropertyTableNumber, 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, isPolymorphic, isSelectBeforeUpdateRequired, isSubclassEntityName, isSubclassPropertyDeferred, isSubclassPropertyNullable, 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, toString, toType, update, update, updateOrInsert, useDynamicInsert, useDynamicUpdate, useGetGeneratedKeys, useInsertSelectIdentity, whereJoinFragment, whereJoinFragment
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getIdentifier, getPropertyValuesToInsert, instantiate, setIdentifier
public JoinedSubclassEntityPersister(PersistentClass persistentClass, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy, PersisterCreationContext creationContext) throws HibernateException
HibernateException
protected boolean isNullableTable(int j)
isNullableTable
in class AbstractEntityPersister
protected boolean isSubclassTableSequentialSelect(int j)
isSubclassTableSequentialSelect
in class AbstractEntityPersister
public String getSubclassPropertyTableName(int i)
OuterJoinLoadable
Return the table name used to persist the numbered property of the class or a subclass.
public Type getDiscriminatorType()
Loadable
Get the discriminator type
public Object getDiscriminatorValue()
Loadable
Get the discriminator value
public String getDiscriminatorSQLValue()
Queryable
Get the discriminator value for this particular concrete subclass, as a string that may be embedded in a select statement
public String getDiscriminatorColumnName()
getDiscriminatorColumnName
in interface Loadable
getDiscriminatorColumnName
in class AbstractEntityPersister
public String getDiscriminatorColumnReaders()
getDiscriminatorColumnReaders
in class AbstractEntityPersister
public String getDiscriminatorColumnReaderTemplate()
getDiscriminatorColumnReaderTemplate
in class AbstractEntityPersister
protected String getDiscriminatorAlias()
getDiscriminatorAlias
in class AbstractEntityPersister
public String getSubclassForDiscriminatorValue(Object value)
Loadable
Get the concrete subclass corresponding to the given discriminator value
protected void addDiscriminatorToInsert(Insert insert)
addDiscriminatorToInsert
in class AbstractEntityPersister
public Serializable[] getPropertySpaces()
EntityPersister
Returns 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 String getTableName(int j)
getTableName
in class AbstractEntityPersister
protected String[] getKeyColumns(int j)
getKeyColumns
in class AbstractEntityPersister
protected boolean isTableCascadeDeleteEnabled(int j)
isTableCascadeDeleteEnabled
in class AbstractEntityPersister
protected boolean isPropertyOfTable(int property, int j)
isPropertyOfTable
in class AbstractEntityPersister
public String fromTableFragment(String alias)
OuterJoinLoadable
Get the main from table fragment, given a query alias.
public String getTableName()
Joinable
The table to join to.
public void addDiscriminatorToSelect(SelectFragment select, String name, String suffix)
addDiscriminatorToSelect
in class AbstractEntityPersister
public String filterFragment(String alias)
filterFragment
in class AbstractEntityPersister
public String filterFragment(String alias, Set<String> treatAsDeclarations)
filterFragment
in class AbstractEntityPersister
public String generateFilterConditionAlias(String rootAlias)
Queryable
The alias used for any filter conditions (mapped where-fragments or enabled-filters). </p> This may or may not be different from the root alias depending upon the inheritance mapping strategy.
generateFilterConditionAlias
in interface Queryable
generateFilterConditionAlias
in class AbstractEntityPersister
rootAlias
- The root aliaspublic String[] getIdentifierColumnNames()
Loadable
Get the names of columns used to persist the identifier
getIdentifierColumnNames
in interface PostInsertIdentityPersister
getIdentifierColumnNames
in interface Loadable
getIdentifierColumnNames
in interface Queryable
getIdentifierColumnNames
in class AbstractEntityPersister
public String[] getIdentifierColumnReaderTemplates()
getIdentifierColumnReaderTemplates
in class AbstractEntityPersister
public String[] getIdentifierColumnReaders()
getIdentifierColumnReaders
in class AbstractEntityPersister
public String[] toColumns(String alias, String propertyName) throws QueryException
AbstractEntityPersister
Obtain aliased column/formula fragments for the specified property path.
Warning: When there are duplicated property names in the subclasses then this method may return the wrong results. To ensure correct results, this method should only be used when this is the concrete EntityPersister (since the concrete EntityPersister cannot have duplicated property names).
toColumns
in interface PropertyMapping
toColumns
in class AbstractEntityPersister
QueryException
protected int[] getPropertyTableNumbersInSelect()
getPropertyTableNumbersInSelect
in class AbstractEntityPersister
protected int getSubclassPropertyTableNumber(int i)
getSubclassPropertyTableNumber
in class AbstractEntityPersister
public int getTableSpan()
getTableSpan
in class AbstractEntityPersister
public boolean isMultiTable()
Queryable
Is the inheritance hierarchy described by this persister contained across multiple tables?
isMultiTable
in interface Queryable
isMultiTable
in class AbstractEntityPersister
protected int[] getSubclassColumnTableNumberClosure()
getSubclassColumnTableNumberClosure
in class AbstractEntityPersister
protected int[] getSubclassFormulaTableNumberClosure()
getSubclassFormulaTableNumberClosure
in class AbstractEntityPersister
protected int[] getPropertyTableNumbers()
getPropertyTableNumbers
in class AbstractEntityPersister
protected String[] getSubclassTableKeyColumns(int j)
getSubclassTableKeyColumns
in class AbstractEntityPersister
public String getSubclassTableName(int j)
Queryable
Get the name of the table with the given index from the internal array.
getSubclassTableName
in interface Queryable
getSubclassTableName
in class AbstractEntityPersister
j
- The index into the internal array.public int getSubclassTableSpan()
getSubclassTableSpan
in class AbstractEntityPersister
protected boolean isSubclassTableLazy(int j)
isSubclassTableLazy
in class AbstractEntityPersister
protected boolean isClassOrSuperclassTable(int j)
isClassOrSuperclassTable
in class AbstractEntityPersister
protected boolean isSubclassTableIndicatedByTreatAsDeclarations(int subclassTableNumber, Set<String> treatAsDeclarations)
isSubclassTableIndicatedByTreatAsDeclarations
in class AbstractEntityPersister
public String getPropertyTableName(String propertyName)
OuterJoinLoadable
Get the table name for the given property path
public String[] getConstraintOrderedTableNameClosure()
Queryable
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.
public String[][] getContraintOrderedTableKeyColumnClosure()
Queryable
For 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 String getRootTableName()
Lockable
Locks are always applied to the "root table".
getRootTableName
in interface Lockable
getRootTableName
in class AbstractEntityPersister
public String getRootTableAlias(String drivingAlias)
Lockable
Get the SQL alias this persister would use for the root table given the passed driving alias.
getRootTableAlias
in interface Lockable
getRootTableAlias
in class AbstractEntityPersister
drivingAlias
- The driving alias; or the alias for the table
mapped by this persister in the hierarchy.public Queryable.Declarer getSubclassPropertyDeclarer(String propertyPath)
Queryable
Determine whether the given property is declared by our
mapped class, our super class, or one of our subclasses…
<p/>
Note: the method is called 'subclass property…' simply
for consistency sake (e.g. Queryable.getSubclassPropertyTableNumber(java.lang.String)
getSubclassPropertyDeclarer
in interface Queryable
getSubclassPropertyDeclarer
in class AbstractEntityPersister
propertyPath
- The property name.public int determineTableNumberForColumn(String columnName)
determineTableNumberForColumn
in class AbstractEntityPersister
public org.hibernate.internal.FilterAliasGenerator getFilterAliasGenerator(String rootAlias)
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.