|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.hibernate.persister.AbstractPropertyMapping net.sf.hibernate.persister.AbstractEntityPersister net.sf.hibernate.persister.EntityPersister
The default implementation of the ClassPersister interface. Implements the "table-per-class-hierarchy" mapping strategy for an entity class.
Field Summary |
Fields inherited from class net.sf.hibernate.persister.AbstractEntityPersister |
ENTITY_CLASS |
Fields inherited from interface net.sf.hibernate.persister.ClassPersister |
ENTITY_ID |
Constructor Summary | |
EntityPersister(PersistentClass model,
SessionFactoryImplementor factory)
|
Method Summary | |
int |
countSubclassProperties()
How many properties are there, for this class and all subclasses. |
protected int |
dehydrate(Serializable id,
Object[] fields,
boolean[] includeProperty,
PreparedStatement st,
SessionImplementor session)
Marshall the fields of a persistent instance to a prepared statement |
void |
delete(Serializable id,
Object version,
Object object,
SessionImplementor session)
Delete an object |
int |
enableJoinedFetch(int i)
May this property be fetched using an SQL outerjoin. |
String |
fromJoinFragment(String alias,
boolean innerJoin,
boolean includeSubclasses)
Get the from clause part of any joins (optional operation) |
String |
fromTableFragment(String name)
Get the main from table fragment, given a query alias. |
protected String |
generateConcreteSelectString(boolean[] includeProperty)
Generate the SQL that selects a row by id, excluding subclasses |
protected String |
generateDeleteString()
Generate the SQL that deletes a row by id (and version) |
protected String |
generateInsertString(boolean identityInsert,
boolean[] includeProperty)
Generate the SQL that inserts a row |
protected String |
generateLockString()
Generate the SQL that pessimistic locks a row by id (and version) |
protected String |
generateSelectForUpdateNowaitString()
Generate the SQL that selects a row by id using FOR UPDATE |
protected String |
generateSelectForUpdateString()
Generate the SQL that selects a row by id using FOR UPDATE |
protected String |
generateSelectString()
Generate the SQL that selects a row by id |
protected String |
generateUpdateString(boolean[] includeProperty)
Generate the SQL that updates a row by id (and version) |
protected String |
generateUpdateString(boolean[] includeProperty,
Object[] oldFields)
|
protected String[] |
getActualPropertyColumnNames(int i)
|
protected String |
getConcreteSelectString()
|
String |
getDiscriminatorAlias()
|
String |
getDiscriminatorColumnName()
Get the name of the column used as a discriminator |
Object |
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 String |
getFormulaTemplate(int i)
|
String[] |
getPropertyColumnNames(int i)
Get the column names for the numbered property of this class |
Serializable[] |
getPropertySpaces()
Returns an array of objects that identify spaces in which properties of this class instance are persisted. |
protected String |
getSQLDeleteString()
The query that deletes a row by id (and version) |
protected String |
getSQLIdentityInsertString()
The query that inserts a row, letting the database generate an id |
protected String |
getSQLInsertString()
The query that inserts a row with a given id |
protected String |
getSQLUpdateString()
The query that updates a row by id (and version) |
Class[] |
getSubclassClosure()
|
Class |
getSubclassForDiscriminatorValue(Object value)
Get the concrete subclass corresponding to the given discriminator value |
String[] |
getSubclassPropertyColumnNames(int i)
Return the column names used to persist the numbered property of the class or a subclass. |
String |
getSubclassPropertyName(int i)
Get the name of the numbered property of the class or a subclass. |
String |
getSubclassPropertyTableName(int i)
Return the table name used to persist the numbered property of the class or a subclass. |
Type |
getSubclassPropertyType(int i)
Get the type of the numbered property of the class or a subclass. |
String |
getTableName()
The table to join to. |
protected String |
getVersionedTableName()
|
protected String |
getVersionSelectString()
|
Serializable |
insert(Object[] fields,
boolean[] notNull,
String sql,
Object object,
SessionImplementor session)
Persist an object, using a natively generated identifier |
Serializable |
insert(Object[] fields,
Object object,
SessionImplementor session)
Persist an instance, using a natively generated identifier (optional operation) |
void |
insert(Serializable id,
Object[] fields,
boolean[] notNull,
String sql,
Object object,
SessionImplementor session)
Persist an object |
void |
insert(Serializable id,
Object[] fields,
Object object,
SessionImplementor session)
Persist an instance |
boolean |
isCacheInvalidationRequired()
Should we always invalidate the cache instead of recaching updated state |
boolean |
isDefinedOnSubclass(int i)
Is this property defined on a subclass of the mapped class. |
Object |
load(Serializable id,
Object optionalObject,
LockMode lockMode,
SessionImplementor session)
Load an instance using either the forUpdateLoader or the outer joining loader, depending upon the value of the lock parameter |
void |
postInstantiate()
Finish the initialization of this object, once all ClassPersisters have been instantiated. |
String |
propertySelectFragment(String name,
String suffix)
Given a query alias and an identifying suffix, render the property select fragment. |
String |
queryWhereFragment(String name,
boolean innerJoin,
boolean includeSubclasses)
Get the where clause fragment, given a query alias |
String[] |
toColumns(String name,
int i)
Given the number of a property of a subclass, and a table alias, return the aliased column names. |
void |
update(Serializable id,
Object[] fields,
int[] dirtyFields,
Object[] oldFields,
Object oldVersion,
Object object,
SessionImplementor session)
Update an object |
protected void |
update(Serializable id,
Object[] fields,
Object[] oldFields,
boolean[] includeProperty,
Object oldVersion,
Object object,
String sql,
SessionImplementor session)
|
String |
whereJoinFragment(String alias,
boolean innerJoin,
boolean includeSubclasses)
Get the where clause part of any joins (optional operation) |
Methods inherited from class net.sf.hibernate.persister.AbstractPropertyMapping |
addFormulaPropertyPath, addPropertyPath, handlePath, initComponentPropertyPaths, initIdentifierPropertyPaths, initPropertyPaths, initPropertyPaths, toColumns, toType |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.hibernate.persister.Queryable |
getIdentifierColumnNames, getMappedSuperclass, identifierSelectFragment, isExplicitPolymorphism, isInherited |
Methods inherited from interface net.sf.hibernate.persister.Loadable |
getDiscriminatorAlias, getIdentifierAliases, getPropertyAliases, hasSubclasses |
Methods inherited from interface net.sf.hibernate.persister.PropertyMapping |
getType, toColumns, toType |
Methods inherited from interface net.sf.hibernate.persister.Joinable |
consumesAlias, getJoinKeyColumnNames, getName, isCollection, isManyToMany, selectFragment |
Constructor Detail |
public EntityPersister(PersistentClass model, SessionFactoryImplementor factory) throws HibernateException
Method Detail |
public void postInstantiate() throws MappingException
ClassPersister
postInstantiate
in interface ClassPersister
MappingException
public boolean isDefinedOnSubclass(int i)
OuterJoinLoadable
isDefinedOnSubclass
in interface OuterJoinLoadable
public String getDiscriminatorColumnName()
OuterJoinLoadable
getDiscriminatorColumnName
in interface OuterJoinLoadable
public String getDiscriminatorAlias()
getDiscriminatorAlias
in class AbstractEntityPersister
public int enableJoinedFetch(int i)
OuterJoinLoadable
enableJoinedFetch
in interface OuterJoinLoadable
public Type getSubclassPropertyType(int i)
OuterJoinLoadable
getSubclassPropertyType
in interface OuterJoinLoadable
public String getSubclassPropertyName(int i)
OuterJoinLoadable
getSubclassPropertyName
in interface OuterJoinLoadable
public int countSubclassProperties()
OuterJoinLoadable
countSubclassProperties
in interface OuterJoinLoadable
public String getTableName()
Joinable
getTableName
in interface Joinable
public String[] getSubclassPropertyColumnNames(int i)
OuterJoinLoadable
getSubclassPropertyColumnNames
in interface OuterJoinLoadable
public String[] getPropertyColumnNames(int i)
AbstractEntityPersister
getPropertyColumnNames
in class AbstractEntityPersister
public Type getDiscriminatorType()
Loadable
getDiscriminatorType
in interface Loadable
public Object getDiscriminatorSQLValue()
Queryable
getDiscriminatorSQLValue
in interface Queryable
public Class[] getSubclassClosure()
public Class getSubclassForDiscriminatorValue(Object value)
Loadable
getSubclassForDiscriminatorValue
in interface Loadable
public Serializable[] getPropertySpaces()
ClassPersister
getPropertySpaces
in interface ClassPersister
protected final String getSQLDeleteString()
protected final String getSQLInsertString()
protected final String getSQLIdentityInsertString()
protected final String getSQLUpdateString()
protected final String getVersionSelectString()
getVersionSelectString
in class AbstractEntityPersister
protected String generateDeleteString()
protected String generateInsertString(boolean identityInsert, boolean[] includeProperty)
protected String generateSelectForUpdateString()
protected String generateSelectForUpdateNowaitString()
protected String generateSelectString()
protected String generateConcreteSelectString(boolean[] includeProperty)
protected String generateUpdateString(boolean[] includeProperty)
protected String generateUpdateString(boolean[] includeProperty, Object[] oldFields)
protected String generateLockString()
generateLockString
in class AbstractEntityPersister
protected int dehydrate(Serializable id, Object[] fields, boolean[] includeProperty, PreparedStatement st, SessionImplementor session) throws SQLException, HibernateException
SQLException
HibernateException
public Object load(Serializable id, Object optionalObject, LockMode lockMode, SessionImplementor session) throws HibernateException
load
in interface ClassPersister
HibernateException
public Serializable insert(Object[] fields, Object object, SessionImplementor session) throws HibernateException
ClassPersister
insert
in interface ClassPersister
HibernateException
public void insert(Serializable id, Object[] fields, Object object, SessionImplementor session) throws HibernateException
ClassPersister
insert
in interface ClassPersister
HibernateException
public void insert(Serializable id, Object[] fields, boolean[] notNull, String sql, Object object, SessionImplementor session) throws HibernateException
HibernateException
public Serializable insert(Object[] fields, boolean[] notNull, String sql, Object object, SessionImplementor session) throws HibernateException
HibernateException
public void delete(Serializable id, Object version, Object object, SessionImplementor session) throws HibernateException
delete
in interface ClassPersister
HibernateException
public void update(Serializable id, Object[] fields, int[] dirtyFields, Object[] oldFields, Object oldVersion, Object object, SessionImplementor session) throws HibernateException
update
in interface ClassPersister
HibernateException
protected void update(Serializable id, Object[] fields, Object[] oldFields, boolean[] includeProperty, Object oldVersion, Object object, String sql, SessionImplementor session) throws HibernateException
HibernateException
public String fromTableFragment(String name)
OuterJoinLoadable
fromTableFragment
in interface OuterJoinLoadable
public String queryWhereFragment(String name, boolean innerJoin, boolean includeSubclasses) throws MappingException
Queryable
queryWhereFragment
in interface Queryable
MappingException
public String[] toColumns(String name, int i)
OuterJoinLoadable
toColumns
in interface OuterJoinLoadable
public String getSubclassPropertyTableName(int i)
OuterJoinLoadable
getSubclassPropertyTableName
in interface OuterJoinLoadable
public String propertySelectFragment(String name, String suffix)
Queryable
propertySelectFragment
in interface Queryable
public String fromJoinFragment(String alias, boolean innerJoin, boolean includeSubclasses)
Joinable
fromJoinFragment
in interface Joinable
public String whereJoinFragment(String alias, boolean innerJoin, boolean includeSubclasses)
Joinable
whereJoinFragment
in interface Joinable
protected String[] getActualPropertyColumnNames(int i)
getActualPropertyColumnNames
in class AbstractEntityPersister
protected String getFormulaTemplate(int i)
getFormulaTemplate
in class AbstractEntityPersister
protected String getConcreteSelectString()
getConcreteSelectString
in class AbstractEntityPersister
public boolean isCacheInvalidationRequired()
ClassPersister
isCacheInvalidationRequired
in interface ClassPersister
protected String getVersionedTableName()
getVersionedTableName
in class AbstractEntityPersister
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |