Package org.castor.cpa.jpa.info
Class JPACallbackHandler
java.lang.Object
org.castor.cpa.jpa.info.JPACallbackHandler
- All Implemented Interfaces:
CallbackInterceptor
Handles JPA annotation-driven callback hooks.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled to indicate that an object has been created.voidCalled 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.voidCalled to indicate that an object has been modified and is up to storing.voidCalled to indicate that an object has been made transient.voidCalled to indicate that an object has been deleted.voidCalled to indicate that an object is to be deleted.voidCalled to indicate that an object is to be stored in persistent storage.voidCalled to indicate that an object has been updated at the end of a "long" transaction.voidCalled to indicate that an object has been made persistent.
-
Constructor Details
-
JPACallbackHandler
public JPACallbackHandler()
-
-
Method Details
-
loaded
Description copied from interface:CallbackInterceptorCalled to indicate that the object has been loaded from persistent storage.- Specified by:
loadedin interfaceCallbackInterceptor- Parameters:
object- The object- Returns:
- null or the extending Class. In the latter case Castor will reload the object of the given class with the same identity.
- Throws:
Exception- An exception occured, the object cannot be loaded
-
modifying
Description copied from interface:CallbackInterceptorCalled to indicate that an object has been modified and is up to storing.- Specified by:
modifyingin interfaceCallbackInterceptor- Parameters:
object- The object- Throws:
Exception- An exception occured, the object cannot be stored
-
storing
Description copied from interface:CallbackInterceptorCalled to indicate that an object is to be stored in persistent storage.- Specified by:
storingin interfaceCallbackInterceptor- Parameters:
object- The objectmodified- Is the object modified?- Throws:
Exception- An exception occured, the object cannot be stored
-
creating
Description copied from interface:CallbackInterceptorCalled to indicate that an object is to be created in persistent storage.- Specified by:
creatingin interfaceCallbackInterceptor- Parameters:
object- The objectdb- The database in which this object will be created- Throws:
Exception
-
created
Description copied from interface:CallbackInterceptorCalled to indicate that an object has been created.- Specified by:
createdin interfaceCallbackInterceptor- Parameters:
object- The object- Throws:
Exception
-
removing
Description copied from interface:CallbackInterceptorCalled to indicate that an object is to be deleted.This method is made at commit time on objects deleted during the transaction before setting their fields to null.
- Specified by:
removingin interfaceCallbackInterceptor- Parameters:
object- The object- Throws:
Exception
-
removed
Description copied from interface:CallbackInterceptorCalled to indicate that an object has been deleted.This method is called during db.remove().
- Specified by:
removedin interfaceCallbackInterceptor- Parameters:
object- The object- Throws:
Exception
-
releasing
Description copied from interface:CallbackInterceptorCalled to indicate that an object has been made transient.This method is made at commit or rollback time on all objects that were presistent during the life time of the transaction.
- Specified by:
releasingin interfaceCallbackInterceptor- Parameters:
object- The objectcommitted- True if the object has been commited, false if rollback or otherwise cancelled
-
using
Description copied from interface:CallbackInterceptorCalled to indicate that an object has been made persistent.- Specified by:
usingin interfaceCallbackInterceptor- Parameters:
object- The objectdb- The database to which this object belongs
-
updated
Description copied from interface:CallbackInterceptorCalled to indicate that an object has been updated at the end of a "long" transaction.- Specified by:
updatedin interfaceCallbackInterceptor- Parameters:
object- The object- Throws:
Exception
-