|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sf.hibernate.persister.AbstractPropertyMapping
net.sf.hibernate.persister.AbstractEntityPersister
Superclass for built-in mapping strategies. Implements functionality
common to both mapping strategies.
May be considered an immutable view of the mapping object.
| 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 |
public static final String ENTITY_CLASS
| Constructor Detail |
protected AbstractEntityPersister(PersistentClass model, SessionFactoryImplementor factory) throws HibernateException
| Method Detail |
public final Class getMappedClass()
ClassMetadata
getMappedClass in interface ClassPersisterpublic final String getClassName()
ClassPersister
getClassName in interface ClassPersistergetClassName in class AbstractPropertyMappingpublic Serializable getIdentifierSpace()
ClassPersister
getIdentifierSpace in interface ClassPersisterpublic String identifierSelectFragment(String name, String suffix)
Queryable
identifierSelectFragment in interface Queryablepublic Cascades.CascadeStyle[] getPropertyCascadeStyles()
ClassPersister
getPropertyCascadeStyles in interface ClassPersisterpublic void setPropertyValues(Object object, Object[] values) throws HibernateException
setPropertyValues in interface ClassPersisterHibernateExceptionpublic Object[] getPropertyValues(Object object) throws HibernateException
getPropertyValues in interface ClassPersisterHibernateExceptionpublic Object getPropertyValue(Object object, int i) throws HibernateException
getPropertyValue in interface ClassPersisterHibernateExceptionpublic void setPropertyValue(Object object, int i, Object value) throws HibernateException
setPropertyValue in interface ClassPersisterHibernateExceptionpublic int[] findDirty(Object[] x, Object[] y, Object object, SessionImplementor session) throws HibernateException
findDirty in interface ClassPersisterHibernateExceptionpublic int[] findModified(Object[] old, Object[] current, Object object, SessionImplementor session) throws HibernateException
findModified in interface ClassPersisterHibernateExceptionpublic Serializable getIdentifier(Object object) throws HibernateException
ClassMetadata
getIdentifier in interface ClassPersisterHibernateExceptionpublic Object getVersion(Object object) throws HibernateException
ClassMetadata
getVersion in interface ClassPersisterHibernateExceptionpublic void setIdentifier(Object object, Serializable id) throws HibernateException
ClassMetadata
setIdentifier in interface ClassPersisterHibernateExceptionpublic Object instantiate(Serializable id) throws HibernateException
instantiate in interface ClassPersisterHibernateExceptionprotected Setter[] getSetters()
protected Getter[] getGetters()
public Type[] getPropertyTypes()
ClassMetadata
getPropertyTypes in interface ClassPersisterpublic Type getIdentifierType()
ClassMetadata
getIdentifierType in interface ClassPersisterpublic String[] getIdentifierColumnNames()
OuterJoinLoadable
getIdentifierColumnNames in interface OuterJoinLoadablegetIdentifierColumnNames in class AbstractPropertyMappingprotected String[] getIdentifierAliases()
public boolean isPolymorphic()
public boolean isInherited()
Queryable
isInherited in interface Queryablepublic boolean hasCascades()
ClassPersister
hasCascades in interface ClassPersisterpublic CacheConcurrencyStrategy getCache()
ClassPersister
getCache in interface ClassPersisterpublic boolean hasIdentifierProperty()
ClassMetadata
hasIdentifierProperty in interface ClassPersisterpublic VersionType getVersionType()
ClassPersister
getVersionType in interface ClassPersisterpublic int getVersionProperty()
ClassMetadata
getVersionProperty in interface ClassPersisterpublic boolean isVersioned()
ClassMetadata
isVersioned in interface ClassPersisterpublic boolean isBatchable()
public boolean isIdentifierAssignedByInsert()
ClassPersister
isIdentifierAssignedByInsert in interface ClassPersisterpublic boolean isUnsaved(Object object) throws HibernateException
ClassPersister
isUnsaved in interface ClassPersisterHibernateExceptionpublic String[] getPropertyNames()
ClassMetadata
getPropertyNames in interface ClassPersisterpublic String getIdentifierPropertyName()
ClassMetadata
getIdentifierPropertyName in interface ClassPersisterpublic String getVersionColumnName()
public boolean implementsLifecycle()
ClassMetadata
implementsLifecycle in interface ClassPersisterpublic boolean implementsValidatable()
ClassMetadata
implementsValidatable in interface ClassPersisterpublic boolean hasCollections()
ClassPersister
hasCollections in interface ClassPersisterpublic boolean isMutable()
ClassMetadata
isMutable in interface ClassPersisterpublic boolean hasCache()
ClassPersister
hasCache in interface ClassPersisterpublic boolean hasSubclasses()
Loadable
hasSubclasses in interface Loadablepublic boolean hasProxy()
ClassMetadata
hasProxy in interface ClassPersisterprotected final String sqlIdentitySelect()
public IdentifierGenerator getIdentifierGenerator() throws HibernateException
ClassPersister
getIdentifierGenerator in interface ClassPersisterHibernateException
protected void check(int rows,
Serializable id)
throws HibernateException
HibernateExceptionprotected abstract String[] getActualPropertyColumnNames(int i)
protected abstract String getFormulaTemplate(int i)
protected void initPropertyPaths(SessionFactoryImplementor factory) throws MappingException
MappingExceptionprotected ProxyFactory createProxyFactory()
protected void initSubclassPropertyAliasesMap(PersistentClass model) throws MappingException
MappingExceptionprotected void initLockers()
protected abstract String generateLockString()
public ClassMetadata getClassMetadata()
ClassPersister
getClassMetadata in interface ClassPersisterpublic Class getConcreteProxyClass()
ClassPersister
getConcreteProxyClass in interface ClassPersisterpublic Class getMappedSuperclass()
Queryable
getMappedSuperclass in interface Queryablepublic boolean isExplicitPolymorphism()
Queryable
isExplicitPolymorphism in interface Queryablepublic boolean[] getPropertyUpdateability()
ClassPersister
getPropertyUpdateability in interface ClassPersisterpublic boolean[] getPropertyNullability()
ClassMetadata
getPropertyNullability in interface ClassPersisterprotected boolean useDynamicUpdate()
protected boolean useDynamicInsert()
public boolean[] getPropertyInsertability()
ClassPersister
getPropertyInsertability in interface ClassPersisterpublic Object getPropertyValue(Object object, String propertyName) throws HibernateException
ClassMetadata
getPropertyValue in interface ClassPersisterHibernateExceptionpublic void setPropertyValue(Object object, String propertyName, Object value) throws HibernateException
ClassMetadata
setPropertyValue in interface ClassMetadataHibernateExceptionprotected boolean hasEmbeddedIdentifier()
public boolean[] getNotNullInsertableColumns(Object[] fields)
protected Dialect getDialect()
protected String getSQLWhereString(String alias)
protected boolean hasWhere()
public boolean hasIdentifierPropertyOrEmbeddedCompositeIdentifier()
ClassPersister
hasIdentifierPropertyOrEmbeddedCompositeIdentifier in interface ClassPersisterprotected void checkColumnDuplication(Set distinctColumns, Iterator columns) throws MappingException
MappingExceptionprotected UniqueEntityLoader createEntityLoader(SessionFactoryImplementor factory) throws MappingException
MappingExceptionprotected void createUniqueKeyLoaders(SessionFactoryImplementor factory) throws MappingException
MappingExceptionpublic Type getType()
SQLLoadable
getType in interface PropertyMappingprotected int getHydrateSpan()
public boolean isBatchLoadable()
ClassPersister
isBatchLoadable in interface ClassPersisterpublic String[] getSubclassPropertyColumnAliases(String propertyName, String suffix)
SQLLoadable
getSubclassPropertyColumnAliases in interface SQLLoadablepublic String[] getJoinKeyColumnNames()
Joinable
getJoinKeyColumnNames in interface Joinablepublic String getName()
Joinable
public String selectFragment(String alias, String suffix)
OuterJoinLoadable
selectFragment in interface OuterJoinLoadablepublic String[] getIdentifierAliases(String suffix)
Loadable
getIdentifierAliases in interface Loadablepublic String[] getPropertyAliases(String suffix, int i)
Loadable
getPropertyAliases in interface Loadablepublic String getDiscriminatorAlias(String suffix)
Loadable
getDiscriminatorAlias in interface Loadableprotected abstract String getDiscriminatorAlias()
public Object loadByUniqueKey(String propertyName, Serializable uniqueKey, SessionImplementor session) throws HibernateException, SQLException
UniqueKeyLoadable
loadByUniqueKey in interface UniqueKeyLoadableHibernateException
SQLExceptionpublic String[] getUniqueKeyColumnNames(String propertyName)
UniqueKeyLoadable
getUniqueKeyColumnNames in interface UniqueKeyLoadablepublic boolean isCollection()
Joinable
isCollection in interface Joinablepublic boolean consumesAlias()
Joinable
consumesAlias in interface Joinablepublic Type getPropertyType(String propertyName) throws MappingException
ClassMetadata
getPropertyType in interface ClassPersisterMappingExceptionprotected boolean hasSelectBeforeUpdate()
protected abstract String getVersionSelectString()
public Object getCurrentVersion(Serializable id, SessionImplementor session) throws HibernateException
getCurrentVersion in interface ClassPersisterHibernateExceptionpublic void lock(Serializable id, Object version, Object object, LockMode lockMode, SessionImplementor session) throws HibernateException
lock in interface ClassPersisterHibernateExceptionprotected Serializable getGeneratedIdentity(Object object, SessionImplementor session, ResultSet rs) throws SQLException, HibernateException, IdentifierGenerationException
public Object[] getCurrentPersistentState(Serializable id, Object version, SessionImplementor session) throws HibernateException
ClassPersister
getCurrentPersistentState in interface ClassPersisterHibernateExceptionprotected abstract String getVersionedTableName()
protected String generateSelectVersionString()
protected abstract String getConcreteSelectString()
protected final int optimisticLockMode()
public boolean isManyToMany()
Joinable
isManyToMany in interface Joinablepublic Object createProxy(Serializable id, SessionImplementor session) throws HibernateException
ClassPersister
createProxy in interface ClassPersisterHibernateExceptionprotected final boolean[] getPropertiesToUpdate(int[] dirtyProperties)
public String toString()
protected abstract String[] getPropertyColumnNames(int i)
public final String selectFragment(String alias, String suffix, boolean includeCollectionColumns)
Joinable
selectFragment in interface Joinableprotected JDBCException convert(SQLException sqlException, String message)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||