|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Concrete ClassPersisters implement mapping and persistence
logic for a particular persistent class.
Implementors must be threadsafe (preferrably immutable) and must
provide a constructor of type
(net.sf.hibernate.map.PersistentClass, net.sf.hibernate.impl.SessionFactoryImplementor).
EntityPersister
Field Summary | |
static String |
ENTITY_ID
The property name of the "special" identifier property in HQL |
Method Summary | |
Object |
createProxy(Serializable id,
SessionImplementor session)
Create a new proxy instance |
void |
delete(Serializable id,
Object version,
Object object,
SessionImplementor session)
Delete a persistent instance |
int[] |
findDirty(Object[] x,
Object[] y,
Object owner,
SessionImplementor session)
Compare two snapshots of the state of an instance to determine if the persistent state was modified |
int[] |
findModified(Object[] old,
Object[] current,
Object object,
SessionImplementor session)
Compare the state of an instance to the current database state |
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). |
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)
Get the current version of the object, or return null if there is no row for the given identifier. |
Serializable |
getIdentifier(Object object)
Get the identifier of an instance (throw an exception if no identifier property) |
IdentifierGenerator |
getIdentifierGenerator()
Return the IdentifierGenerator for the class |
String |
getIdentifierPropertyName()
Get the name of the identifier property (or return null) - need not return the name of an actual Java property |
Serializable |
getIdentifierSpace()
Returns an object that identifies the space in which identifiers of this class hierarchy are unique. |
Type |
getIdentifierType()
Get the identifier type |
Class |
getMappedClass()
The persistent class |
Cascades.CascadeStyle[] |
getPropertyCascadeStyles()
Get the cascade styles of the propertes (optional operation) |
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 properties - doesn't have to be the names of the actual Java properties (used for XML generation only) |
boolean[] |
getPropertyNullability()
Get the nullability of the properties of this class |
Serializable[] |
getPropertySpaces()
Returns an array of objects that identify spaces in which properties of this class instance are persisted. |
Type |
getPropertyType(String propertyName)
Get the type of a particular 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 a particular property |
Object |
getPropertyValue(Object object,
String propertyName)
Get the value of a particular property |
Object[] |
getPropertyValues(Object object)
Return the values of the mapped properties of the object |
Object |
getVersion(Object object)
Get the version number (or timestamp) from the object's version property (or return null if not versioned) |
int |
getVersionProperty()
Which property holds the version number (optional operation). |
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. |
boolean |
hasIdentifierProperty()
Does the class have a property holding the identifier value? |
boolean |
hasIdentifierPropertyOrEmbeddedCompositeIdentifier()
Do detached instances of this class carry their own identifier value? |
boolean |
hasProxy()
Does this class support dynamic proxies. |
boolean |
implementsLifecycle()
Does the class implement the Lifecycle interface. |
boolean |
implementsValidatable()
Does the class implement the Validatable interface. |
Serializable |
insert(Object[] fields,
Object object,
SessionImplementor session)
Persist an instance, using a natively generated identifier (optional operation) |
void |
insert(Serializable id,
Object[] fields,
Object object,
SessionImplementor session)
Persist an instance |
Object |
instantiate(Serializable id)
Create a class instance initialized with the given identifier |
boolean |
isBatchLoadable()
Is batch loading enabled? |
boolean |
isCacheInvalidationRequired()
Should we always invalidate the cache instead of recaching updated state |
boolean |
isIdentifierAssignedByInsert()
Is the identifier assigned before the insert by an IDGenerator. |
boolean |
isMutable()
Are instances of this class mutable. |
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 |
load(Serializable id,
Object optionalObject,
LockMode lockMode,
SessionImplementor session)
Load an instance of the persistent class. |
void |
lock(Serializable id,
Object version,
Object object,
LockMode lockMode,
SessionImplementor session)
Do a version check (optional operation) |
void |
postInstantiate()
Finish the initialization of this object, once all ClassPersisters have been instantiated. |
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 a particular property |
void |
setPropertyValues(Object object,
Object[] values)
Set the given values to the mapped properties of the given object |
void |
update(Serializable id,
Object[] fields,
int[] dirtyFields,
Object[] oldFields,
Object oldVersion,
Object object,
SessionImplementor session)
Update a persistent instance |
Field Detail |
public static final String ENTITY_ID
Method Detail |
public void postInstantiate() throws MappingException
MappingException
public Serializable getIdentifierSpace()
public Serializable[] getPropertySpaces()
public Class getMappedClass()
public String getClassName()
public boolean implementsLifecycle()
public boolean implementsValidatable()
public boolean hasProxy()
public Class getConcreteProxyClass()
public Object createProxy(Serializable id, SessionImplementor session) throws HibernateException
HibernateException
public boolean hasCollections()
public boolean hasCascades()
public boolean isMutable()
public boolean isIdentifierAssignedByInsert()
public boolean isUnsaved(Object object) throws HibernateException
HibernateException
public void setPropertyValues(Object object, Object[] values) throws HibernateException
HibernateException
public Object[] getPropertyValues(Object object) throws HibernateException
HibernateException
public void setPropertyValue(Object object, int i, Object value) throws HibernateException
HibernateException
public Object getPropertyValue(Object object, int i) throws HibernateException
HibernateException
public Object getPropertyValue(Object object, String propertyName) throws HibernateException
HibernateException
public Type getPropertyType(String propertyName) throws MappingException
MappingException
public int[] findDirty(Object[] x, Object[] y, Object owner, SessionImplementor session) throws HibernateException
HibernateException
public int[] findModified(Object[] old, Object[] current, Object object, SessionImplementor session) throws HibernateException
HibernateException
public boolean hasIdentifierProperty()
public boolean hasIdentifierPropertyOrEmbeddedCompositeIdentifier()
public Serializable getIdentifier(Object object) throws HibernateException
HibernateException
public void setIdentifier(Object object, Serializable id) throws HibernateException
HibernateException
public boolean isVersioned()
public VersionType getVersionType()
public int getVersionProperty()
public Object getVersion(Object object) throws HibernateException
HibernateException
public Object instantiate(Serializable id) throws HibernateException
HibernateException
public IdentifierGenerator getIdentifierGenerator() throws HibernateException
HibernateException
public Object load(Serializable id, Object optionalObject, LockMode lockMode, SessionImplementor session) throws HibernateException
HibernateException
public void lock(Serializable id, Object version, Object object, LockMode lockMode, SessionImplementor session) throws HibernateException
HibernateException
public void insert(Serializable id, Object[] fields, Object object, SessionImplementor session) throws HibernateException
HibernateException
public Serializable insert(Object[] fields, Object object, SessionImplementor session) throws HibernateException
HibernateException
public void delete(Serializable id, Object version, Object object, SessionImplementor session) throws HibernateException
HibernateException
public void update(Serializable id, Object[] fields, int[] dirtyFields, Object[] oldFields, Object oldVersion, Object object, SessionImplementor session) throws HibernateException
HibernateException
public Type[] getPropertyTypes()
public String[] getPropertyNames()
public boolean[] getPropertyUpdateability()
public boolean[] getPropertyNullability()
public boolean[] getPropertyInsertability()
public Cascades.CascadeStyle[] getPropertyCascadeStyles()
public Type getIdentifierType()
public String getIdentifierPropertyName()
public boolean isCacheInvalidationRequired()
public boolean hasCache()
public CacheConcurrencyStrategy getCache()
public ClassMetadata getClassMetadata()
public boolean isBatchLoadable()
public Object[] getCurrentPersistentState(Serializable id, Object version, SessionImplementor session) throws HibernateException
HibernateException
public Object getCurrentVersion(Serializable id, SessionImplementor session) throws HibernateException
HibernateException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |