站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 2.1.8 正式版 API 英文文档

AbstractEntityPersister (Hibernate API Documentation) - Hibernate 2.1.8 正式版 API 英文文档


net.sf.hibernate.persister
Class AbstractEntityPersister

java.lang.Object
  extended bynet.sf.hibernate.persister.AbstractPropertyMapping
      extended bynet.sf.hibernate.persister.AbstractEntityPersister
All Implemented Interfaces:
ClassMetadata, ClassPersister, Joinable, Loadable, OuterJoinLoadable, PropertyMapping, Queryable, SQLLoadable, UniqueKeyLoadable
Direct Known Subclasses:
EntityPersister, NormalizedEntityPersister

public abstract class AbstractEntityPersister
extends AbstractPropertyMapping
implements OuterJoinLoadable, Queryable, ClassMetadata, UniqueKeyLoadable, SQLLoadable

Superclass for built-in mapping strategies. Implements functionality common to both mapping strategies.

May be considered an immutable view of the mapping object.

Author:
Gavin King

Field Summary
static String ENTITY_CLASS
           
 
Fields inherited from interface net.sf.hibernate.persister.ClassPersister
ENTITY_ID
 
Constructor Summary
protected AbstractEntityPersister(PersistentClass model, SessionFactoryImplementor factory)
           
 
Method Summary
protected  void check(int rows, Serializable id)
           
protected  void checkColumnDuplication(Set distinctColumns, Iterator columns)
           
 boolean consumesAlias()
          Ugly, very ugly....
protected  JDBCException convert(SQLException sqlException, String message)
           
protected  UniqueEntityLoader createEntityLoader(SessionFactoryImplementor factory)
           
 Object createProxy(Serializable id, SessionImplementor session)
          Create a new proxy instance
protected  ProxyFactory createProxyFactory()
          Create a new ProxyFactory.
protected  void createUniqueKeyLoaders(SessionFactoryImplementor factory)
           
 int[] findDirty(Object[] x, Object[] y, Object object, SessionImplementor session)
          Determine if the given field values are dirty
 int[] findModified(Object[] old, Object[] current, Object object, SessionImplementor session)
          Determine if the given field values are dirty
protected abstract  String generateLockString()
           
protected  String generateSelectVersionString()
          Generate the SQL that selects the version number by id
protected abstract  String[] getActualPropertyColumnNames(int i)
           
 CacheConcurrencyStrategy getCache()
          Get the cache (optional operation)
 ClassMetadata getClassMetadata()
          Get the user-visible metadata for the class (optional operation)
 String getClassName()
          The classname of the persistent class (used only for messages)
 Class getConcreteProxyClass()
          Get the proxy interface that instances of this concrete class will be cast to (optional operation).
protected abstract  String getConcreteSelectString()
           
 Object[] getCurrentPersistentState(Serializable id, Object version, SessionImplementor session)
          Get the current database state of the object, in a "hydrated" form, without resolving identifiers
 Object getCurrentVersion(Serializable id, SessionImplementor session)
          Retrieve the version number
protected  Dialect getDialect()
           
protected abstract  String getDiscriminatorAlias()
           
 String getDiscriminatorAlias(String suffix)
          Get the result set aliases used for the identifier columns, given a suffix
protected abstract  String getFormulaTemplate(int i)
           
protected  Serializable getGeneratedIdentity(Object object, SessionImplementor session, ResultSet rs)
          Get the generated identifier when using identity columns
protected  Getter[] getGetters()
           
protected  int getHydrateSpan()
           
 Serializable getIdentifier(Object object)
          Get the identifier of an instance (throw an exception if no identifier property)
protected  String[] getIdentifierAliases()
           
 String[] getIdentifierAliases(String suffix)
          Get the result set aliases used for the identifier columns, given a suffix
 String[] getIdentifierColumnNames()
          Get the names of columns used to persist the identifier
 IdentifierGenerator getIdentifierGenerator()
          Return the IdentifierGenerator for the class
 String getIdentifierPropertyName()
          Get the name of the identifier property (or return null)
 Serializable getIdentifierSpace()
          Returns an object that identifies the space in which identifiers of this class hierarchy are unique.
 Type getIdentifierType()
          Get the identifier Hibernate type
 String[] getJoinKeyColumnNames()
          The columns to join on.
 Class getMappedClass()
          The persistent class
 Class getMappedSuperclass()
          Get the class that this class is mapped as a subclass of - not necessarily the direct superclass
 String getName()
          An identifying name; a class name or collection role name.
 boolean[] getNotNullInsertableColumns(Object[] fields)
           
protected  boolean[] getPropertiesToUpdate(int[] dirtyProperties)
          Transform the array of property indexes to an array of booleans
 String[] getPropertyAliases(String suffix, int i)
          Get the result set aliases used for the property columns, given a suffix (properties of this class, only).
 Cascades.CascadeStyle[] getPropertyCascadeStyles()
          Get the cascade styles of the propertes (optional operation)
protected abstract  String[] getPropertyColumnNames(int i)
          Get the column names for the numbered property of this class
 boolean[] getPropertyInsertability()
          Get the "insertability" of the properties of this class (does the property appear in an SQL INSERT)
 String[] getPropertyNames()
          Get the names of the class' persistent properties
 boolean[] getPropertyNullability()
          Get the nullability of the class' persistent properties
 Type getPropertyType(String propertyName)
          Get the type of a particular (named) property
 Type[] getPropertyTypes()
          Get the Hibernate types of the class properties
 boolean[] getPropertyUpdateability()
          Get the "updateability" of the properties of this class (does the property appear in an SQL UPDATE)
 Object getPropertyValue(Object object, int i)
          Get the value of the numbered property
 Object getPropertyValue(Object object, String propertyName)
          Get the value of a particular (named) property
 Object[] getPropertyValues(Object object)
          Return the values of the mapped properties of the object
protected  Setter[] getSetters()
           
protected  String getSQLWhereString(String alias)
           
 String[] getSubclassPropertyColumnAliases(String propertyName, String suffix)
          Return the column alias names used to persist/query the numbered property of the class or a subclass (optional operation).
 Type getType()
          Get the type
 String[] getUniqueKeyColumnNames(String propertyName)
          Get the columns of the unique key.
 Object getVersion(Object object)
          Get the version number (or timestamp) from the object's version property (or return null if not versioned)
 String getVersionColumnName()
           
protected abstract  String getVersionedTableName()
           
 int getVersionProperty()
          Get the index of the version property
protected abstract  String getVersionSelectString()
           
 VersionType getVersionType()
          Get the type of versioning (optional operation)
 boolean hasCache()
          Does this class have a cache.
 boolean hasCascades()
          Does this class declare any cascading save/update/deletes.
 boolean hasCollections()
          Do instances of this class contain collections.
protected  boolean hasEmbeddedIdentifier()
           
 boolean hasIdentifierProperty()
          Does this class have an identifier property?
 boolean hasIdentifierPropertyOrEmbeddedCompositeIdentifier()
          Do detached instances of this class carry their own identifier value?
 boolean hasProxy()
          Does this class support dynamic proxies?
protected  boolean hasSelectBeforeUpdate()
           
 boolean hasSubclasses()
          Does this persistent class have subclasses?
protected  boolean hasWhere()
           
 String identifierSelectFragment(String name, String suffix)
          Given a query alias and an identifying suffix, render the intentifier select fragment.
 boolean implementsLifecycle()
          Does the class implement the Lifecycle interface?
 boolean implementsValidatable()
          Does the class implement the Validatable interface?
protected  void initLockers()
           
protected  void initPropertyPaths(SessionFactoryImplementor factory)
           
protected  void initSubclassPropertyAliasesMap(PersistentClass model)
          Must be called by subclasses, at the end of their constructors
 Object instantiate(Serializable id)
          Return a new instance initialized with the given identifier
 boolean isBatchable()
           
 boolean isBatchLoadable()
          Is batch loading enabled?
 boolean isCollection()
          Is this instance actually a CollectionPersister?
 boolean isExplicitPolymorphism()
          Is this class explicit polymorphism only?
 boolean isIdentifierAssignedByInsert()
          Is the identifier assigned before the insert by an IDGenerator.
 boolean isInherited()
          Is this class mapped as a subclass of another class?
 boolean isManyToMany()
          Is this instance actually a many-to-many association?
 boolean isMutable()
          Are instances of this class mutable?
 boolean isPolymorphic()
           
 boolean isUnsaved(Object object)
          Is this a new transient instance?
 boolean isVersioned()
          Are instances of this class versioned by a timestamp or version number column?
 Object loadByUniqueKey(String propertyName, Serializable uniqueKey, SessionImplementor session)
          Load an instance of the persistent class, by a unique key other than the primary key.
 void lock(Serializable id, Object version, Object object, LockMode lockMode, SessionImplementor session)
          Do a version check
protected  int optimisticLockMode()
           
 String selectFragment(String alias, String suffix)
          Generate a list of collection index and element columns
 String selectFragment(String alias, String suffix, boolean includeCollectionColumns)
          All columns to select, when loading.
 void setIdentifier(Object object, Serializable id)
          Set the identifier of an instance (or do nothing if no identifier property)
 void setPropertyValue(Object object, int i, Object value)
          Set the value of the numbered property
 void setPropertyValue(Object object, String propertyName, Object value)
          Set the value of a particular (named) property
 void setPropertyValues(Object object, Object[] values)
          Set the given values to the mapped properties of the given object
protected  String sqlIdentitySelect()
          The query that returns the generated identifier for an identity column
 String toString()
           
protected  boolean useDynamicInsert()
           
protected  boolean useDynamicUpdate()
           
 
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.OuterJoinLoadable
countSubclassProperties, enableJoinedFetch, fromTableFragment, getDiscriminatorColumnName, getSubclassPropertyColumnNames, getSubclassPropertyName, getSubclassPropertyTableName, getSubclassPropertyType, isDefinedOnSubclass, toColumns
 
Methods inherited from interface net.sf.hibernate.persister.Loadable
getDiscriminatorType, getSubclassForDiscriminatorValue
 
Methods inherited from interface net.sf.hibernate.persister.ClassPersister
delete, getPropertySpaces, insert, insert, isCacheInvalidationRequired, load, postInstantiate, update
 
Methods inherited from interface net.sf.hibernate.persister.Joinable
fromJoinFragment, getTableName, whereJoinFragment
 
Methods inherited from interface net.sf.hibernate.persister.Queryable
getDiscriminatorSQLValue, propertySelectFragment, queryWhereFragment
 
Methods inherited from interface net.sf.hibernate.persister.PropertyMapping
toColumns, toType
 

Field Detail

ENTITY_CLASS

public static final String ENTITY_CLASS
See Also:
Constant Field Values
Constructor Detail

AbstractEntityPersister

protected AbstractEntityPersister(PersistentClass model,
                                  SessionFactoryImplementor factory)
                           throws HibernateException
Method Detail

getMappedClass

public final Class getMappedClass()
Description copied from interface: ClassMetadata
The persistent class

Specified by:
getMappedClass in interface ClassPersister

getClassName

public final String getClassName()
Description copied from interface: ClassPersister
The classname of the persistent class (used only for messages)

Specified by:
getClassName in interface ClassPersister
Specified by:
getClassName in class AbstractPropertyMapping

getIdentifierSpace

public Serializable getIdentifierSpace()
Description copied from interface: ClassPersister
Returns an object that identifies the space in which identifiers of this class hierarchy are unique. A table name, a JNDI URL, etc.

Specified by:
getIdentifierSpace in interface ClassPersister

identifierSelectFragment

public String identifierSelectFragment(String name,
                                       String suffix)
Description copied from interface: Queryable
Given a query alias and an identifying suffix, render the intentifier select fragment.

Specified by:
identifierSelectFragment in interface Queryable

getPropertyCascadeStyles

public Cascades.CascadeStyle[] getPropertyCascadeStyles()
Description copied from interface: ClassPersister
Get the cascade styles of the propertes (optional operation)

Specified by:
getPropertyCascadeStyles in interface ClassPersister

setPropertyValues

public void setPropertyValues(Object object,
                              Object[] values)
                       throws HibernateException
Set the given values to the mapped properties of the given object

Specified by:
setPropertyValues in interface ClassPersister
Throws:
HibernateException

getPropertyValues

public Object[] getPropertyValues(Object object)
                           throws HibernateException
Return the values of the mapped properties of the object

Specified by:
getPropertyValues in interface ClassPersister
Throws:
HibernateException

getPropertyValue

public Object getPropertyValue(Object object,
                               int i)
                        throws HibernateException
Get the value of the numbered property

Specified by:
getPropertyValue in interface ClassPersister
Throws:
HibernateException

setPropertyValue

public void setPropertyValue(Object object,
                             int i,
                             Object value)
                      throws HibernateException
Set the value of the numbered property

Specified by:
setPropertyValue in interface ClassPersister
Throws:
HibernateException

findDirty

public int[] findDirty(Object[] x,
                       Object[] y,
                       Object object,
                       SessionImplementor session)
                throws HibernateException
Determine if the given field values are dirty

Specified by:
findDirty in interface ClassPersister
Returns:
null or the indices of the dirty properties
Throws:
HibernateException

findModified

public int[] findModified(Object[] old,
                          Object[] current,
                          Object object,
                          SessionImplementor session)
                   throws HibernateException
Determine if the given field values are dirty

Specified by:
findModified in interface ClassPersister
Returns:
null or the indices of the dirty properties
Throws:
HibernateException

getIdentifier

public Serializable getIdentifier(Object object)
                           throws HibernateException
Description copied from interface: ClassMetadata
Get the identifier of an instance (throw an exception if no identifier property)

Specified by:
getIdentifier in interface ClassPersister
Throws:
HibernateException

getVersion

public Object getVersion(Object object)
                  throws HibernateException
Description copied from interface: ClassMetadata
Get the version number (or timestamp) from the object's version property (or return null if not versioned)

Specified by:
getVersion in interface ClassPersister
Throws:
HibernateException

setIdentifier

public void setIdentifier(Object object,
                          Serializable id)
                   throws HibernateException
Description copied from interface: ClassMetadata
Set the identifier of an instance (or do nothing if no identifier property)

Specified by:
setIdentifier in interface ClassPersister
Throws:
HibernateException

instantiate

public Object instantiate(Serializable id)
                   throws HibernateException
Return a new instance initialized with the given identifier

Specified by:
instantiate in interface ClassPersister
Throws:
HibernateException

getSetters

protected Setter[] getSetters()

getGetters

protected Getter[] getGetters()

getPropertyTypes

public Type[] getPropertyTypes()
Description copied from interface: ClassMetadata
Get the Hibernate types of the class properties

Specified by:
getPropertyTypes in interface ClassPersister

getIdentifierType

public Type getIdentifierType()
Description copied from interface: ClassMetadata
Get the identifier Hibernate type

Specified by:
getIdentifierType in interface ClassPersister

getIdentifierColumnNames

public String[] getIdentifierColumnNames()
Description copied from interface: OuterJoinLoadable
Get the names of columns used to persist the identifier

Specified by:
getIdentifierColumnNames in interface OuterJoinLoadable
Overrides:
getIdentifierColumnNames in class AbstractPropertyMapping

getIdentifierAliases

protected String[] getIdentifierAliases()

isPolymorphic

public boolean isPolymorphic()

isInherited

public boolean isInherited()
Description copied from interface: Queryable
Is this class mapped as a subclass of another class?

Specified by:
isInherited in interface Queryable

hasCascades

public boolean hasCascades()
Description copied from interface: ClassPersister
Does this class declare any cascading save/update/deletes.

Specified by:
hasCascades in interface ClassPersister

getCache

public CacheConcurrencyStrategy getCache()
Description copied from interface: ClassPersister
Get the cache (optional operation)

Specified by:
getCache in interface ClassPersister

hasIdentifierProperty

public boolean hasIdentifierProperty()
Description copied from interface: ClassMetadata
Does this class have an identifier property?

Specified by:
hasIdentifierProperty in interface ClassPersister

getVersionType

public VersionType getVersionType()
Description copied from interface: ClassPersister
Get the type of versioning (optional operation)

Specified by:
getVersionType in interface ClassPersister

getVersionProperty

public int getVersionProperty()
Description copied from interface: ClassMetadata
Get the index of the version property

Specified by:
getVersionProperty in interface ClassPersister

isVersioned

public boolean isVersioned()
Description copied from interface: ClassMetadata
Are instances of this class versioned by a timestamp or version number column?

Specified by:
isVersioned in interface ClassPersister

isBatchable

public boolean isBatchable()

isIdentifierAssignedByInsert

public boolean isIdentifierAssignedByInsert()
Description copied from interface: ClassPersister
Is the identifier assigned before the insert by an IDGenerator. Or is it returned by the insert() method? This determines which form of insert() will be called.

Specified by:
isIdentifierAssignedByInsert in interface ClassPersister

isUnsaved

public boolean isUnsaved(Object object)
                  throws HibernateException
Description copied from interface: ClassPersister
Is this a new transient instance?

Specified by:
isUnsaved in interface ClassPersister
Throws:
HibernateException

getPropertyNames

public String[] getPropertyNames()
Description copied from interface: ClassMetadata
Get the names of the class' persistent properties

Specified by:
getPropertyNames in interface ClassPersister

getIdentifierPropertyName

public String getIdentifierPropertyName()
Description copied from interface: ClassMetadata
Get the name of the identifier property (or return null)

Specified by:
getIdentifierPropertyName in interface ClassPersister

getVersionColumnName

public String getVersionColumnName()

implementsLifecycle

public boolean implementsLifecycle()
Description copied from interface: ClassMetadata
Does the class implement the Lifecycle interface?

Specified by:
implementsLifecycle in interface ClassPersister

implementsValidatable

public boolean implementsValidatable()
Description copied from interface: ClassMetadata
Does the class implement the Validatable interface?

Specified by:
implementsValidatable in interface ClassPersister

hasCollections

public boolean hasCollections()
Description copied from interface: ClassPersister
Do instances of this class contain collections.

Specified by:
hasCollections in interface ClassPersister

isMutable

public boolean isMutable()
Description copied from interface: ClassMetadata
Are instances of this class mutable?

Specified by:
isMutable in interface ClassPersister

hasCache

public boolean hasCache()
Description copied from interface: ClassPersister
Does this class have a cache.

Specified by:
hasCache in interface ClassPersister

hasSubclasses

public boolean hasSubclasses()
Description copied from interface: Loadable
Does this persistent class have subclasses?

Specified by:
hasSubclasses in interface Loadable

hasProxy

public boolean hasProxy()
Description copied from interface: ClassMetadata
Does this class support dynamic proxies?

Specified by:
hasProxy in interface ClassPersister

sqlIdentitySelect

protected final String sqlIdentitySelect()
The query that returns the generated identifier for an identity column


getIdentifierGenerator

public IdentifierGenerator getIdentifierGenerator()
                                           throws HibernateException
Description copied from interface: ClassPersister
Return the IdentifierGenerator for the class

Specified by:
getIdentifierGenerator in interface ClassPersister
Throws:
HibernateException

check

protected void check(int rows,
                     Serializable id)
              throws HibernateException
Throws:
HibernateException

getActualPropertyColumnNames

protected abstract String[] getActualPropertyColumnNames(int i)

getFormulaTemplate

protected abstract String getFormulaTemplate(int i)

initPropertyPaths

protected void initPropertyPaths(SessionFactoryImplementor factory)
                          throws MappingException
Throws:
MappingException

createProxyFactory

protected ProxyFactory createProxyFactory()
Create a new ProxyFactory. Returns a CGLIBProxyFactory by default, may be overridden by a subclass.


initSubclassPropertyAliasesMap

protected void initSubclassPropertyAliasesMap(PersistentClass model)
                                       throws MappingException
Must be called by subclasses, at the end of their constructors

Throws:
MappingException

initLockers

protected void initLockers()

generateLockString

protected abstract String generateLockString()

getClassMetadata

public ClassMetadata getClassMetadata()
Description copied from interface: ClassPersister
Get the user-visible metadata for the class (optional operation)

Specified by:
getClassMetadata in interface ClassPersister

getConcreteProxyClass

public Class getConcreteProxyClass()
Description copied from interface: ClassPersister
Get the proxy interface that instances of this concrete class will be cast to (optional operation).

Specified by:
getConcreteProxyClass in interface ClassPersister

getMappedSuperclass

public Class getMappedSuperclass()
Description copied from interface: Queryable
Get the class that this class is mapped as a subclass of - not necessarily the direct superclass

Specified by:
getMappedSuperclass in interface Queryable

isExplicitPolymorphism

public boolean isExplicitPolymorphism()
Description copied from interface: Queryable
Is this class explicit polymorphism only?

Specified by:
isExplicitPolymorphism in interface Queryable

getPropertyUpdateability

public boolean[] getPropertyUpdateability()
Description copied from interface: ClassPersister
Get the "updateability" of the properties of this class (does the property appear in an SQL UPDATE)

Specified by:
getPropertyUpdateability in interface ClassPersister

getPropertyNullability

public boolean[] getPropertyNullability()
Description copied from interface: ClassMetadata
Get the nullability of the class' persistent properties

Specified by:
getPropertyNullability in interface ClassPersister

useDynamicUpdate

protected boolean useDynamicUpdate()

useDynamicInsert

protected boolean useDynamicInsert()

getPropertyInsertability

public boolean[] getPropertyInsertability()
Description copied from interface: ClassPersister
Get the "insertability" of the properties of this class (does the property appear in an SQL INSERT)

Specified by:
getPropertyInsertability in interface ClassPersister

getPropertyValue

public Object getPropertyValue(Object object,
                               String propertyName)
                        throws HibernateException
Description copied from interface: ClassMetadata
Get the value of a particular (named) property

Specified by:
getPropertyValue in interface ClassPersister
Throws:
HibernateException

setPropertyValue

public void setPropertyValue(Object object,
                             String propertyName,
                             Object value)
                      throws HibernateException
Description copied from interface: ClassMetadata
Set the value of a particular (named) property

Specified by:
setPropertyValue in interface ClassMetadata
Throws:
HibernateException

hasEmbeddedIdentifier

protected boolean hasEmbeddedIdentifier()

getNotNullInsertableColumns

public boolean[] getNotNullInsertableColumns(Object[] fields)

getDialect

protected Dialect getDialect()

getSQLWhereString

protected String getSQLWhereString(String alias)

hasWhere

protected boolean hasWhere()

hasIdentifierPropertyOrEmbeddedCompositeIdentifier

public boolean hasIdentifierPropertyOrEmbeddedCompositeIdentifier()
Description copied from interface: ClassPersister
Do detached instances of this class carry their own identifier value?

Specified by:
hasIdentifierPropertyOrEmbeddedCompositeIdentifier in interface ClassPersister

checkColumnDuplication

protected void checkColumnDuplication(Set distinctColumns,
                                      Iterator columns)
                               throws MappingException
Throws:
MappingException

createEntityLoader

protected UniqueEntityLoader createEntityLoader(SessionFactoryImplementor factory)
                                         throws MappingException
Throws:
MappingException

createUniqueKeyLoaders

protected void createUniqueKeyLoaders(SessionFactoryImplementor factory)
                               throws MappingException
Throws:
MappingException

getType

public Type getType()
Description copied from interface: SQLLoadable
Get the type

Specified by:
getType in interface PropertyMapping

getHydrateSpan

protected int getHydrateSpan()

isBatchLoadable

public boolean isBatchLoadable()
Description copied from interface: ClassPersister
Is batch loading enabled?

Specified by:
isBatchLoadable in interface ClassPersister

getSubclassPropertyColumnAliases

public String[] getSubclassPropertyColumnAliases(String propertyName,
                                                 String suffix)
Description copied from interface: SQLLoadable
Return the column alias names used to persist/query the numbered property of the class or a subclass (optional operation).

Specified by:
getSubclassPropertyColumnAliases in interface SQLLoadable

getJoinKeyColumnNames

public String[] getJoinKeyColumnNames()
Description copied from interface: Joinable
The columns to join on.

Specified by:
getJoinKeyColumnNames in interface Joinable

getName

public String getName()
Description copied from interface: Joinable
An identifying name; a class name or collection role name.

Specified by:
getName in interface Joinable

selectFragment

public String selectFragment(String alias,
                             String suffix)
Description copied from interface: OuterJoinLoadable
Generate a list of collection index and element columns

Specified by:
selectFragment in interface OuterJoinLoadable

getIdentifierAliases

public String[] getIdentifierAliases(String suffix)
Description copied from interface: Loadable
Get the result set aliases used for the identifier columns, given a suffix

Specified by:
getIdentifierAliases in interface Loadable

getPropertyAliases

public String[] getPropertyAliases(String suffix,
                                   int i)
Description copied from interface: Loadable
Get the result set aliases used for the property columns, given a suffix (properties of this class, only).

Specified by:
getPropertyAliases in interface Loadable

getDiscriminatorAlias

public String getDiscriminatorAlias(String suffix)
Description copied from interface: Loadable
Get the result set aliases used for the identifier columns, given a suffix

Specified by:
getDiscriminatorAlias in interface Loadable

getDiscriminatorAlias

protected abstract String getDiscriminatorAlias()

loadByUniqueKey

public Object loadByUniqueKey(String propertyName,
                              Serializable uniqueKey,
                              SessionImplementor session)
                       throws HibernateException,
                              SQLException
Description copied from interface: UniqueKeyLoadable
Load an instance of the persistent class, by a unique key other than the primary key.

Specified by:
loadByUniqueKey in interface UniqueKeyLoadable
Throws:
HibernateException
SQLException

getUniqueKeyColumnNames

public String[] getUniqueKeyColumnNames(String propertyName)
Description copied from interface: UniqueKeyLoadable
Get the columns of the unique key.

Specified by:
getUniqueKeyColumnNames in interface UniqueKeyLoadable

isCollection

public boolean isCollection()
Description copied from interface: Joinable
Is this instance actually a CollectionPersister?

Specified by:
isCollection in interface Joinable

consumesAlias

public boolean consumesAlias()
Description copied from interface: Joinable
Ugly, very ugly....

Specified by:
consumesAlias in interface Joinable

getPropertyType

public Type getPropertyType(String propertyName)
                     throws MappingException
Description copied from interface: ClassMetadata
Get the type of a particular (named) property

Specified by:
getPropertyType in interface ClassPersister
Throws:
MappingException

hasSelectBeforeUpdate

protected boolean hasSelectBeforeUpdate()

getVersionSelectString

protected abstract String getVersionSelectString()

getCurrentVersion

public Object getCurrentVersion(Serializable id,
                                SessionImplementor session)
                         throws HibernateException
Retrieve the version number

Specified by:
getCurrentVersion in interface ClassPersister
Throws:
HibernateException

lock

public void lock(Serializable id,
                 Object version,
                 Object object,
                 LockMode lockMode,
                 SessionImplementor session)
          throws HibernateException
Do a version check

Specified by:
lock in interface ClassPersister
Throws:
HibernateException

getGeneratedIdentity

protected Serializable getGeneratedIdentity(Object object,
                                            SessionImplementor session,
                                            ResultSet rs)
                                     throws SQLException,
                                            HibernateException,
                                            IdentifierGenerationException
Get the generated identifier when using identity columns

Throws:
SQLException
HibernateException
IdentifierGenerationException

getCurrentPersistentState

public Object[] getCurrentPersistentState(Serializable id,
                                          Object version,
                                          SessionImplementor session)
                                   throws HibernateException
Description copied from interface: ClassPersister
Get the current database state of the object, in a "hydrated" form, without resolving identifiers

Specified by:
getCurrentPersistentState in interface ClassPersister
Returns:
null if select-before-update is not enabled or not supported
Throws:
HibernateException

getVersionedTableName

protected abstract String getVersionedTableName()

generateSelectVersionString

protected String generateSelectVersionString()
Generate the SQL that selects the version number by id


getConcreteSelectString

protected abstract String getConcreteSelectString()

optimisticLockMode

protected final int optimisticLockMode()

isManyToMany

public boolean isManyToMany()
Description copied from interface: Joinable
Is this instance actually a many-to-many association?

Specified by:
isManyToMany in interface Joinable

createProxy

public Object createProxy(Serializable id,
                          SessionImplementor session)
                   throws HibernateException
Description copied from interface: ClassPersister
Create a new proxy instance

Specified by:
createProxy in interface ClassPersister
Throws:
HibernateException

getPropertiesToUpdate

protected final boolean[] getPropertiesToUpdate(int[] dirtyProperties)
Transform the array of property indexes to an array of booleans


toString

public String toString()

getPropertyColumnNames

protected abstract String[] getPropertyColumnNames(int i)
Get the column names for the numbered property of this class


selectFragment

public final String selectFragment(String alias,
                                   String suffix,
                                   boolean includeCollectionColumns)
Description copied from interface: Joinable
All columns to select, when loading.

Specified by:
selectFragment in interface Joinable

convert

protected JDBCException convert(SQLException sqlException,
                                String message)