org.hibernate.persister.entity

Interface Queryable

All Superinterfaces:
EntityPersister, Joinable, Loadable, OptimisticCacheSource, PropertyMapping
Known Implementing Classes:
AbstractEntityPersister, JoinedSubclassEntityPersister, SingleTableEntityPersister, UnionSubclassEntityPersister

public interface Queryable
extends Loadable, PropertyMapping, Joinable

Extends the generic EntityPersister contract to add operations required by the Hibernate Query Language
Author:
Gavin King

Nested Class Summary

static class
Queryable.Declarer

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

ENTITY_ID

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

ROWID_ALIAS

Method Summary

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 contraint violations.
String[][]
getContraintOrderedTableKeyColumnClosure()
For each table specified in getConstraintOrderedTableNameClosure(), get the columns that define the key between the various hierarchy classes.
String
getDiscriminatorSQLValue()
Get the discriminator value for this particular concrete subclass, as a string that may be embedded in a select statement
String[]
getIdentifierColumnNames()
Get the names of columns used to persist the identifier
String
getMappedSuperclass()
Get the class that this class is mapped as a subclass of - not necessarily the direct superclass
Queryable.Declarer
getSubclassPropertyDeclarer(String propertyPath)
Determine whether the given property is declared by our mapped class, our super class, or one of our subclasses...
int
getSubclassPropertyTableNumber(String propertyPath)
Given a property name, determine the number of the table which contains the column to which this property is mapped.
String
getSubclassTableName(int number)
Get the name of the table with the given index from the internal array.
String
getTemporaryIdTableDDL()
Get the appropriate DDL command for generating the temporary table to be used to (potentially) store id values when performing bulk update/deletes.
String
getTemporaryIdTableName()
Get the name of the temporary table to be used to (potentially) store id values when performing bulk update/deletes.
String
identifierSelectFragment(String name, String suffix)
Given a query alias and an identifying suffix, render the intentifier select fragment.
boolean
isAbstract()
Is this an abstract class?
boolean
isExplicitPolymorphism()
Is this class explicit polymorphism only?
boolean
isMultiTable()
Is the inheritence hierarchy described by this persister contained across multiple tables?
boolean
isVersionPropertyInsertable()
Is the version property included in insert statements?
String
propertySelectFragment(String alias, String suffix, boolean allProperties)
Given a query alias and an identifying suffix, render the property select fragment.

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

afterInitialize, afterReassociate, canExtractIdOutOfEntity, createProxy, delete, findDirty, findModified, forceVersionIncrement, getCacheAccessStrategy, getCacheEntryStructure, getClassMetadata, getConcreteProxyClass, getCurrentVersion, getDatabaseSnapshot, getEntityMetamodel, getEntityName, getFactory, getIdentifier, getIdentifierGenerator, getIdentifierPropertyName, getIdentifierType, getMappedClass, getNaturalIdentifierProperties, getNaturalIdentifierSnapshot, getPropertyCascadeStyles, getPropertyCheckability, getPropertyInsertGenerationInclusions, getPropertyInsertability, getPropertyLaziness, getPropertyNames, getPropertyNullability, getPropertySpaces, getPropertyType, getPropertyTypes, getPropertyUpdateGenerationInclusions, getPropertyUpdateability, getPropertyValue, getPropertyValue, getPropertyValues, getPropertyValuesToInsert, getPropertyVersionability, getQuerySpaces, getRootEntityName, getSubclassEntityPersister, getVersion, getVersionProperty, getVersionType, guessEntityMode, hasCache, hasCascades, hasCollections, hasIdentifierProperty, hasInsertGeneratedProperties, hasLazyProperties, hasMutableProperties, hasNaturalIdentifier, hasProxy, hasSubselectLoadableCollections, hasUninitializedLazyProperties, hasUpdateGeneratedProperties, implementsLifecycle, implementsValidatable, insert, insert, instantiate, isBatchLoadable, isCacheInvalidationRequired, isIdentifierAssignedByInsert, isInherited, isInstance, isInstrumented, isLazyPropertiesCacheable, isMutable, isSelectBeforeUpdateRequired, isSubclassEntityName, isTransient, isVersionPropertyGenerated, isVersioned, load, lock, postInstantiate, processInsertGeneratedProperties, processUpdateGeneratedProperties, resetIdentifier, setIdentifier, setPropertyValue, setPropertyValues, update

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

consumesCollectionAlias, consumesEntityAlias, filterFragment, fromJoinFragment, getKeyColumnNames, getName, getTableName, isCollection, oneToManyFilterFragment, selectFragment, whereJoinFragment

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

getDiscriminatorAlias, getDiscriminatorColumnName, getDiscriminatorType, getIdentifierAliases, getIdentifierColumnNames, getPropertyAliases, getPropertyColumnNames, getSubclassForDiscriminatorValue, hasRowId, hasSubclasses, hydrate, isAbstract

Methods inherited from interface org.hibernate.cache.OptimisticCacheSource

getVersionComparator, isVersioned

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

getType, toColumns, toColumns, toType

Method Details

generateFilterConditionAlias

public String generateFilterConditionAlias(String rootAlias)
The alias used for any filter conditions (mapped where-fragments or enabled-filters). This may or may not be different from the root alias depending upon the inheritence mapping strategy.
Parameters:
rootAlias - The root alias
Returns:
The alias used for "filter conditions" within the where clause.

getConstraintOrderedTableNameClosure

public 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 contraint violations.
Returns:
The ordered array of table names.

getContraintOrderedTableKeyColumnClosure

public String[][] getContraintOrderedTableKeyColumnClosure()
For each table specified in getConstraintOrderedTableNameClosure(), get the columns that define the key between the various hierarchy classes.

The first dimension here corresponds to the table indexes returned in getConstraintOrderedTableNameClosure().

The second dimension should have the same length across all the elements in the first dimension. If not, that'd be a problem ;)

Returns:

getDiscriminatorSQLValue

public String getDiscriminatorSQLValue()
Get the discriminator value for this particular concrete subclass, as a string that may be embedded in a select statement

getIdentifierColumnNames

public String[] getIdentifierColumnNames()
Get the names of columns used to persist the identifier
Specified by:
getIdentifierColumnNames in interface Loadable

getMappedSuperclass

public String getMappedSuperclass()
Get the class that this class is mapped as a subclass of - not necessarily the direct superclass

getSubclassPropertyDeclarer

public Queryable.Declarer getSubclassPropertyDeclarer(String propertyPath)
Determine whether the given property is declared by our mapped class, our super class, or one of our subclasses...

Note: the method is called 'subclass property...' simply for consistency sake (e.g. getSubclassPropertyTableNumber(String)

Parameters:
propertyPath - The property name.
Returns:
The property declarer

getSubclassPropertyTableNumber

public int getSubclassPropertyTableNumber(String propertyPath)
Parameters:
propertyPath - The name of the property.
Returns:
The nunber of the table to which the property is mapped.

getSubclassTableName

public String getSubclassTableName(int number)
Get the name of the table with the given index from the internal array.
Parameters:
number - The index into the internal array.
Returns:

getTemporaryIdTableDDL

public String getTemporaryIdTableDDL()
Get the appropriate DDL command for generating the temporary table to be used to (potentially) store id values when performing bulk update/deletes.
Returns:
The appropriate temporary table creation command.

getTemporaryIdTableName

public String getTemporaryIdTableName()
Get the name of the temporary table to be used to (potentially) store id values when performing bulk update/deletes.
Returns:
The appropriate temporary table name.

identifierSelectFragment

public String identifierSelectFragment(String name,
                                       String suffix)
Given a query alias and an identifying suffix, render the intentifier select fragment.

isAbstract

public boolean isAbstract()
Is this an abstract class?
Specified by:
isAbstract in interface Loadable

isExplicitPolymorphism

public boolean isExplicitPolymorphism()
Is this class explicit polymorphism only?

isMultiTable

public boolean isMultiTable()
Is the inheritence hierarchy described by this persister contained across multiple tables?
Returns:
True if the inheritence hierarchy is spread across multiple tables; false otherwise.

isVersionPropertyInsertable

public boolean isVersionPropertyInsertable()
Is the version property included in insert statements?

propertySelectFragment

public String propertySelectFragment(String alias,
                                     String suffix,
                                     boolean allProperties)
Given a query alias and an identifying suffix, render the property select fragment.