|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Allows user code to inspect and/or change property values.
Inspection occurs before property values are written and after they are read
from the database.
There might be a single instance of Interceptor for a SessionFactory, or a new instance
might be specified for each Session. Whichever approach is used, the interceptor must be
serializable if the Session is to be serializable. This means that SessionFactory-scoped
interceptors should implement readResolve().
The Session may not be invoked from a callback (nor may a callback cause a collection or proxy to
be lazily initialized).
SessionFactory.openSession(Interceptor)
,
Configuration.setInterceptor(Interceptor)
Method Summary | |
int[] |
findDirty(Object entity,
Serializable id,
Object[] currentState,
Object[] previousState,
String[] propertyNames,
Type[] types)
Called from flush(). |
Object |
instantiate(Class clazz,
Serializable id)
Instantiate the entity class. |
Boolean |
isUnsaved(Object entity)
Called when a transient entity is passed to saveOrUpdate(). |
void |
onDelete(Object entity,
Serializable id,
Object[] state,
String[] propertyNames,
Type[] types)
Called before an object is deleted. |
boolean |
onFlushDirty(Object entity,
Serializable id,
Object[] currentState,
Object[] previousState,
String[] propertyNames,
Type[] types)
Called when an object is detected to be dirty, during a flush. |
boolean |
onLoad(Object entity,
Serializable id,
Object[] state,
String[] propertyNames,
Type[] types)
Called just before an object is initialized. |
boolean |
onSave(Object entity,
Serializable id,
Object[] state,
String[] propertyNames,
Type[] types)
Called before an object is saved. |
void |
postFlush(Iterator entities)
Called after a flush that actually ends in execution of the SQL statements required to synchronize in-memory state with the database. |
void |
preFlush(Iterator entities)
Called before a flush |
Method Detail |
public boolean onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException
CallbackException
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) throws CallbackException
CallbackException
public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException
CallbackException
public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException
CallbackException
public void preFlush(Iterator entities) throws CallbackException
CallbackException
public void postFlush(Iterator entities) throws CallbackException
CallbackException
public Boolean isUnsaved(Object entity)
entity
- a transient entity
public int[] findDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types)
entity
- a persistent entity
public Object instantiate(Class clazz, Serializable id) throws CallbackException
clazz
- a mapped classid
- the identifier of the new instance
CallbackException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |