-
- All Superinterfaces:
EventListener
- All Known Implementing Classes:
DefaultRecordListener
public interface RecordListener extends EventListener
A listener for manipulation events onUpdatableRecords.Users may want to centrally inject custom behaviour when manipulating their
UpdatableRecordobjects, performing CRUD. This service provider allows to hook in callback method implementations for before or after any of these methods:UpdatableRecord.store()UpdatableRecord.insert()UpdatableRecord.update()UpdatableRecord.delete()UpdatableRecord.refresh()
A
RecordListenerdoes not act as a client-side trigger. As such, it does not affect any bulk DML statements (e.g. aDSLContext.update(Table)), whose affected records are not available to clients. For those purposes, use a server-side trigger if records should be changed, or aVisitListenerif the SQL query should be changed, independently of data.- Author:
- Lukas Eder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddeleteEnd(RecordContext ctx)Called after deleting anUpdatableRecord.voiddeleteStart(RecordContext ctx)Called before deleting anUpdatableRecord.voidexception(RecordContext ctx)Called when an exception occurs.voidinsertEnd(RecordContext ctx)Called after inserting anUpdatableRecord.voidinsertStart(RecordContext ctx)Called before inserting anUpdatableRecord.voidloadEnd(RecordContext ctx)Called after loading anUpdatableRecord.voidloadStart(RecordContext ctx)Called before loading anUpdatableRecord.voidmergeEnd(RecordContext ctx)Called after merging anUpdatableRecord.voidmergeStart(RecordContext ctx)Called before merging anUpdatableRecord.voidrefreshEnd(RecordContext ctx)Called after refreshing anUpdatableRecord.voidrefreshStart(RecordContext ctx)Called before refreshing anUpdatableRecord.voidstoreEnd(RecordContext ctx)Called after storing anUpdatableRecord.voidstoreStart(RecordContext ctx)Called before storing anUpdatableRecord.voidupdateEnd(RecordContext ctx)Called after updating anUpdatableRecord.voidupdateStart(RecordContext ctx)Called before updating anUpdatableRecord.
-
-
-
Method Detail
-
storeStart
void storeStart(RecordContext ctx)
Called before storing anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()prior to storing. Note that modifying the record's primary key value may influence whether storing results in anINSERTorUPDATEstatement.A store event will generate a nested
insertStart(RecordContext)orupdateStart(RecordContext)event.- See Also:
UpdatableRecord.store()
-
storeEnd
void storeEnd(RecordContext ctx)
Called after storing anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()after storing. Note that modifying the record's primary key value may influence whether storing results in anINSERTorUPDATEstatement.A store event will generate a nested
insertEnd(RecordContext)orupdateEnd(RecordContext)event.- See Also:
UpdatableRecord.store()
-
insertStart
void insertStart(RecordContext ctx)
Called before inserting anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()prior to inserting.- See Also:
UpdatableRecord.insert()
-
insertEnd
void insertEnd(RecordContext ctx)
Called after inserting anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()after inserting.- See Also:
UpdatableRecord.insert()
-
updateStart
void updateStart(RecordContext ctx)
Called before updating anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()prior to updating.- See Also:
UpdatableRecord.update()
-
updateEnd
void updateEnd(RecordContext ctx)
Called after updating anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()after updating.- See Also:
UpdatableRecord.update()
-
mergeStart
void mergeStart(RecordContext ctx)
Called before merging anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()prior to merging.- See Also:
UpdatableRecord.merge()
-
mergeEnd
void mergeEnd(RecordContext ctx)
Called after merging anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()after merging.- See Also:
UpdatableRecord.merge()
-
deleteStart
void deleteStart(RecordContext ctx)
Called before deleting anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()prior to deleting.- See Also:
UpdatableRecord.delete()
-
deleteEnd
void deleteEnd(RecordContext ctx)
Called after deleting anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()after deleting.- See Also:
UpdatableRecord.delete()
-
loadStart
void loadStart(RecordContext ctx)
Called before loading anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()prior to loading.
-
loadEnd
void loadEnd(RecordContext ctx)
Called after loading anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()after loading.
-
refreshStart
void refreshStart(RecordContext ctx)
Called before refreshing anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()prior to refreshing.- See Also:
UpdatableRecord.refresh()
-
refreshEnd
void refreshEnd(RecordContext ctx)
Called after refreshing anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()after refreshing.- See Also:
UpdatableRecord.refresh()
-
exception
void exception(RecordContext ctx)
Called when an exception occurs.
-
-