|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hibernate.persister.entity.AbstractEntityPersister
org.hibernate.persister.entity.SingleTableEntityPersister
public class SingleTableEntityPersister
The default implementation of the EntityPersister interface. Implements the "table-per-class-hierarchy" or "roll-up" mapping strategy for an entity class and its inheritence hierarchy. This is implemented as a single table holding all classes in the hierarchy with a discrimator column used to determine which concrete class is referenced.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.hibernate.persister.entity.AbstractEntityPersister |
---|
AbstractEntityPersister.InclusionChecker |
Nested classes/interfaces inherited from interface org.hibernate.persister.entity.Queryable |
---|
Queryable.Declarer |
Field Summary |
---|
Fields inherited from class org.hibernate.persister.entity.AbstractEntityPersister |
---|
customSQLDelete, customSQLInsert, customSQLUpdate, deleteCallable, deleteResultCheckStyles, ENTITY_CLASS, insertCallable, insertResultCheckStyles, propertyMapping, rowIdName, updateCallable, updateResultCheckStyles |
Fields inherited from interface org.hibernate.persister.entity.Loadable |
---|
ROWID_ALIAS |
Fields inherited from interface org.hibernate.persister.entity.EntityPersister |
---|
ENTITY_ID |
Fields inherited from interface org.hibernate.intercept.LazyPropertyInitializer |
---|
UNFETCHED_PROPERTY |
Constructor Summary | |
---|---|
SingleTableEntityPersister(PersistentClass persistentClass,
EntityRegionAccessStrategy cacheAccessStrategy,
SessionFactoryImplementor factory,
Mapping mapping)
|
Method Summary | |
---|---|
protected void |
addDiscriminatorToInsert(Insert insert)
|
protected void |
addDiscriminatorToSelect(SelectFragment select,
java.lang.String name,
java.lang.String suffix)
|
java.lang.String |
filterFragment(java.lang.String alias)
|
java.lang.String |
fromTableFragment(java.lang.String name)
Get the main from table fragment, given a query alias. |
java.lang.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. |
java.lang.String[][] |
getContraintOrderedTableKeyColumnClosure()
For each table specified in Queryable.getConstraintOrderedTableNameClosure() , get
the columns that define the key between the various hierarchy classes. |
protected java.lang.String |
getDiscriminatorAlias()
|
java.lang.String |
getDiscriminatorColumnName()
|
java.lang.String |
getDiscriminatorColumnReaders()
|
java.lang.String |
getDiscriminatorColumnReaderTemplate()
|
protected java.lang.String |
getDiscriminatorFormula()
|
protected java.lang.String |
getDiscriminatorFormulaTemplate()
|
java.lang.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 |
protected java.lang.String[] |
getKeyColumns(int j)
|
java.io.Serializable[] |
getPropertySpaces()
Returns an array of objects that identify spaces in which properties of this entity are persisted, for instances of this class only. |
java.lang.String |
getPropertyTableName(java.lang.String propertyName)
Get the table name for the given property path |
protected int[] |
getPropertyTableNumbers()
|
protected int[] |
getPropertyTableNumbersInSelect()
|
protected java.lang.String |
getSequentialSelect(java.lang.String entityName)
|
java.lang.String[] |
getSubclassClosure()
|
protected int[] |
getSubclassColumnTableNumberClosure()
|
java.lang.String |
getSubclassForDiscriminatorValue(java.lang.Object value)
Get the concrete subclass corresponding to the given discriminator value |
protected int[] |
getSubclassFormulaTableNumberClosure()
|
java.lang.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 java.lang.String[] |
getSubclassTableKeyColumns(int j)
|
java.lang.String |
getSubclassTableName(int j)
Get the name of the table with the given index from the internal array. |
int |
getSubclassTableSpan()
|
java.lang.String |
getTableName()
The table to join to. |
protected java.lang.String |
getTableName(int j)
|
int |
getTableSpan()
|
boolean |
hasSequentialSelect()
|
protected boolean |
isClassOrSuperclassTable(int j)
|
protected boolean |
isDiscriminatorFormula()
|
protected boolean |
isInverseSubclassTable(int j)
|
protected boolean |
isInverseTable(int j)
|
boolean |
isMultiTable()
Is the inheritence hierarchy described by this persister contained across multiple tables? |
protected boolean |
isNullableSubclassTable(int j)
|
protected boolean |
isNullableTable(int j)
|
protected boolean |
isPropertyOfTable(int property,
int j)
|
protected boolean |
isSubclassPropertyDeferred(java.lang.String propertyName,
java.lang.String entityName)
|
protected boolean |
isSubclassTableLazy(int j)
|
protected boolean |
isSubclassTableSequentialSelect(int j)
|
protected boolean |
isTableCascadeDeleteEnabled(int j)
|
java.lang.String |
oneToManyFilterFragment(java.lang.String alias)
|
void |
postInstantiate()
Finish the initialization of this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SingleTableEntityPersister(PersistentClass persistentClass, EntityRegionAccessStrategy cacheAccessStrategy, SessionFactoryImplementor factory, Mapping mapping) throws HibernateException
HibernateException
Method Detail |
---|
protected boolean isInverseTable(int j)
isInverseTable
in class AbstractEntityPersister
protected boolean isInverseSubclassTable(int j)
isInverseSubclassTable
in class AbstractEntityPersister
public java.lang.String getDiscriminatorColumnName()
getDiscriminatorColumnName
in interface Loadable
getDiscriminatorColumnName
in class AbstractEntityPersister
public java.lang.String getDiscriminatorColumnReaders()
getDiscriminatorColumnReaders
in class AbstractEntityPersister
public java.lang.String getDiscriminatorColumnReaderTemplate()
getDiscriminatorColumnReaderTemplate
in class AbstractEntityPersister
protected java.lang.String getDiscriminatorAlias()
getDiscriminatorAlias
in class AbstractEntityPersister
protected java.lang.String getDiscriminatorFormulaTemplate()
getDiscriminatorFormulaTemplate
in class AbstractEntityPersister
public java.lang.String getTableName()
Joinable
public Type getDiscriminatorType()
Loadable
public java.lang.String getDiscriminatorSQLValue()
Queryable
public java.lang.String[] getSubclassClosure()
public java.lang.String getSubclassForDiscriminatorValue(java.lang.Object value)
Loadable
public java.io.Serializable[] getPropertySpaces()
EntityPersister
protected boolean isDiscriminatorFormula()
protected java.lang.String getDiscriminatorFormula()
protected java.lang.String getTableName(int j)
getTableName
in class AbstractEntityPersister
protected java.lang.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
protected boolean isSubclassTableSequentialSelect(int j)
isSubclassTableSequentialSelect
in class AbstractEntityPersister
public java.lang.String fromTableFragment(java.lang.String name)
OuterJoinLoadable
public java.lang.String filterFragment(java.lang.String alias) throws MappingException
filterFragment
in class AbstractEntityPersister
MappingException
public java.lang.String oneToManyFilterFragment(java.lang.String alias) throws MappingException
oneToManyFilterFragment
in interface Joinable
oneToManyFilterFragment
in class AbstractEntityPersister
MappingException
public java.lang.String getSubclassPropertyTableName(int i)
OuterJoinLoadable
protected void addDiscriminatorToSelect(SelectFragment select, java.lang.String name, java.lang.String suffix)
addDiscriminatorToSelect
in class AbstractEntityPersister
protected int[] getPropertyTableNumbersInSelect()
getPropertyTableNumbersInSelect
in class AbstractEntityPersister
protected int getSubclassPropertyTableNumber(int i)
getSubclassPropertyTableNumber
in class AbstractEntityPersister
public int getTableSpan()
getTableSpan
in class AbstractEntityPersister
protected void addDiscriminatorToInsert(Insert insert)
addDiscriminatorToInsert
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 boolean isSubclassPropertyDeferred(java.lang.String propertyName, java.lang.String entityName)
isSubclassPropertyDeferred
in class AbstractEntityPersister
public boolean hasSequentialSelect()
hasSequentialSelect
in class AbstractEntityPersister
protected java.lang.String getSequentialSelect(java.lang.String entityName)
getSequentialSelect
in class AbstractEntityPersister
protected java.lang.String[] getSubclassTableKeyColumns(int j)
getSubclassTableKeyColumns
in class AbstractEntityPersister
public java.lang.String getSubclassTableName(int j)
Queryable
getSubclassTableName
in interface Queryable
getSubclassTableName
in class AbstractEntityPersister
j
- The index into the internal array.
public int getSubclassTableSpan()
getSubclassTableSpan
in class AbstractEntityPersister
protected boolean isClassOrSuperclassTable(int j)
isClassOrSuperclassTable
in class AbstractEntityPersister
protected boolean isSubclassTableLazy(int j)
isSubclassTableLazy
in class AbstractEntityPersister
protected boolean isNullableTable(int j)
isNullableTable
in class AbstractEntityPersister
protected boolean isNullableSubclassTable(int j)
isNullableSubclassTable
in class AbstractEntityPersister
public java.lang.String getPropertyTableName(java.lang.String propertyName)
OuterJoinLoadable
public void postInstantiate()
EntityPersister
SessionFactory
lifecycle,
after all entity persisters have been instantiated.
postInstantiate
in interface EntityPersister
postInstantiate
in class AbstractEntityPersister
public boolean isMultiTable()
Queryable
isMultiTable
in interface Queryable
isMultiTable
in class AbstractEntityPersister
public java.lang.String[] getConstraintOrderedTableNameClosure()
Queryable
public java.lang.String[][] getContraintOrderedTableKeyColumnClosure()
Queryable
Queryable.getConstraintOrderedTableNameClosure()
, get
the columns that define the key between the various hierarchy classes.
The first dimension here corresponds to the table indexes returned in
Queryable.getConstraintOrderedTableNameClosure()
.
The second dimension should have the same length across all the elements in
the first dimension. If not, that'd be a problem ;)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |