public class JPACallbackHandler extends Object implements CallbackInterceptor
Constructor and Description |
---|
JPACallbackHandler() |
Modifier and Type | Method and Description |
---|---|
void |
created(Object object)
Called to indicate that an object has been created.
|
void |
creating(Object object,
Database db)
Called to indicate that an object is to be created in persistent
storage.
|
Class<?> |
loaded(Object object,
AccessMode accessMode)
Called to indicate that the object has been loaded from persistent
storage.
|
void |
modifying(Object object)
Called to indicate that an object has been modified and is up to storing.
|
void |
releasing(Object object,
boolean committed)
Called to indicate that an object has been made transient.
|
void |
removed(Object object)
Called to indicate that an object has been deleted.
|
void |
removing(Object object)
Called to indicate that an object is to be deleted.
|
void |
storing(Object object,
boolean modified)
Called to indicate that an object is to be stored in persistent
storage.
|
void |
updated(Object object)
Called to indicate that an object has been updated at the end of
a "long" transaction.
|
void |
using(Object object,
Database db)
Called to indicate that an object has been made persistent.
|
public Class<?> loaded(Object object, AccessMode accessMode) throws Exception
CallbackInterceptor
loaded
in interface CallbackInterceptor
object
- The objectException
- An exception occured, the object cannot be loadedpublic void modifying(Object object) throws Exception
CallbackInterceptor
modifying
in interface CallbackInterceptor
object
- The objectException
- An exception occured, the object cannot be storedpublic void storing(Object object, boolean modified) throws Exception
CallbackInterceptor
storing
in interface CallbackInterceptor
object
- The objectmodified
- Is the object modified?Exception
- An exception occured, the object cannot be storedpublic void creating(Object object, Database db) throws Exception
CallbackInterceptor
creating
in interface CallbackInterceptor
object
- The objectdb
- The database in which this object will be createdException
public void created(Object object) throws Exception
CallbackInterceptor
created
in interface CallbackInterceptor
object
- The objectException
public void removing(Object object) throws Exception
CallbackInterceptor
This method is made at commit time on objects deleted during the transaction before setting their fields to null.
removing
in interface CallbackInterceptor
object
- The objectException
public void removed(Object object) throws Exception
CallbackInterceptor
This method is called during db.remove().
removed
in interface CallbackInterceptor
object
- The objectException
public void releasing(Object object, boolean committed)
CallbackInterceptor
This method is made at commit or rollback time on all objects that were presistent during the life time of the transaction.
releasing
in interface CallbackInterceptor
object
- The objectcommitted
- True if the object has been commited, false
if rollback or otherwise cancelledpublic void using(Object object, Database db)
CallbackInterceptor
using
in interface CallbackInterceptor
object
- The objectdb
- The database to which this object belongspublic void updated(Object object) throws Exception
CallbackInterceptor
updated
in interface CallbackInterceptor
object
- The objectException
Copyright © 2014. All rights reserved.