- All Superinterfaces:
EventListener
- All Known Implementing Classes:
CallbackRecordListener,DefaultRecordListener
UpdatableRecords.
Users may want to centrally inject custom behaviour when manipulating their
UpdatableRecord objects, 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 RecordListener does not act as a client-side trigger. As such,
it does not affect any bulk DML statements (e.g. a
DSLContext.update(Table)), whose affected records are not available
to clients. For those purposes, use a server-side trigger
DSLContext.createTrigger(Name) if records should be changed, or a
VisitListener if the SQL query should be changed, independently of
data.
- Author:
- Lukas Eder
-
Method Summary
Modifier and TypeMethodDescriptiondefault voiddeleteEnd(RecordContext ctx) Called after deleting anUpdatableRecord.default voiddeleteStart(RecordContext ctx) Called before deleting anUpdatableRecord.default voidexception(RecordContext ctx) Called when an exception occurs.default voidinsertEnd(RecordContext ctx) Called after inserting anUpdatableRecord.default voidinsertStart(RecordContext ctx) Called before inserting anUpdatableRecord.default voidloadEnd(RecordContext ctx) Called after loading anUpdatableRecord.default voidloadStart(RecordContext ctx) Called before loading anUpdatableRecord.default voidmergeEnd(RecordContext ctx) Called after merging anUpdatableRecord.default voidmergeStart(RecordContext ctx) Called before merging anUpdatableRecord.static CallbackRecordListeneronDeleteEnd(Consumer<? super RecordContext> onDeleteEnd) Create aRecordListenerwith aonDeleteEnd(Consumer)implementation.static CallbackRecordListeneronDeleteStart(Consumer<? super RecordContext> onDeleteStart) Create aRecordListenerwith aonDeleteStart(Consumer)implementation.static CallbackRecordListeneronException(Consumer<? super RecordContext> onException) Create aRecordListenerwith aonException(Consumer)implementation.static CallbackRecordListeneronInsertEnd(Consumer<? super RecordContext> onInsertEnd) Create aRecordListenerwith aonInsertEnd(Consumer)implementation.static CallbackRecordListeneronInsertStart(Consumer<? super RecordContext> onInsertStart) Create aRecordListenerwith aonInsertStart(Consumer)implementation.static CallbackRecordListeneronLoadEnd(Consumer<? super RecordContext> onLoadEnd) Create aRecordListenerwith aonLoadEnd(Consumer)implementation.static CallbackRecordListeneronLoadStart(Consumer<? super RecordContext> onLoadStart) Create aRecordListenerwith aonLoadStart(Consumer)implementation.static CallbackRecordListeneronMergeEnd(Consumer<? super RecordContext> onMergeEnd) Create aRecordListenerwith aonMergeEnd(Consumer)implementation.static CallbackRecordListeneronMergeStart(Consumer<? super RecordContext> onMergeStart) Create aRecordListenerwith aonMergeStart(Consumer)implementation.static CallbackRecordListeneronRefreshEnd(Consumer<? super RecordContext> onRefreshEnd) Create aRecordListenerwith aonRefreshEnd(Consumer)implementation.static CallbackRecordListeneronRefreshStart(Consumer<? super RecordContext> onRefreshStart) Create aRecordListenerwith aonRefreshStart(Consumer)implementation.static CallbackRecordListeneronStoreEnd(Consumer<? super RecordContext> onStoreEnd) Create aRecordListenerwith aonStoreEnd(Consumer)implementation.static CallbackRecordListeneronStoreStart(Consumer<? super RecordContext> onStoreStart) Create aRecordListenerwith aonStoreStart(Consumer)implementation.static CallbackRecordListeneronUpdateEnd(Consumer<? super RecordContext> onUpdateEnd) Create aRecordListenerwith aonUpdateEnd(Consumer)implementation.static CallbackRecordListeneronUpdateStart(Consumer<? super RecordContext> onUpdateStart) Create aRecordListenerwith aonUpdateStart(Consumer)implementation.default voidrefreshEnd(RecordContext ctx) Called after refreshing anUpdatableRecord.default voidCalled before refreshing anUpdatableRecord.default voidstoreEnd(RecordContext ctx) Called after storing anUpdatableRecord.default voidstoreStart(RecordContext ctx) Called before storing anUpdatableRecord.default voidupdateEnd(RecordContext ctx) Called after updating anUpdatableRecord.default voidupdateStart(RecordContext ctx) Called before updating anUpdatableRecord.
-
Method Details
-
storeStart
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.- Parameters:
ctx- The context containing information about the record operation.- See Also:
-
storeEnd
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.- Parameters:
ctx- The context containing information about the record operation.- See Also:
-
insertStart
Called before inserting anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()prior to inserting.- Parameters:
ctx- The context containing information about the record operation.- See Also:
-
insertEnd
Called after inserting anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()after inserting.- Parameters:
ctx- The context containing information about the record operation.- See Also:
-
updateStart
Called before updating anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()prior to updating.- Parameters:
ctx- The context containing information about the record operation.- See Also:
-
updateEnd
Called after updating anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()after updating.- Parameters:
ctx- The context containing information about the record operation.- See Also:
-
mergeStart
Called before merging anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()prior to merging.- Parameters:
ctx- The context containing information about the record operation.- See Also:
-
mergeEnd
Called after merging anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()after merging.- Parameters:
ctx- The context containing information about the record operation.- See Also:
-
deleteStart
Called before deleting anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()prior to deleting.- Parameters:
ctx- The context containing information about the record operation.- See Also:
-
deleteEnd
Called after deleting anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()after deleting.- Parameters:
ctx- The context containing information about the record operation.- See Also:
-
loadStart
Called before loading anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()prior to loading.- Parameters:
ctx- The context containing information about the record operation.
-
loadEnd
Called after loading anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()after loading.- Parameters:
ctx- The context containing information about the record operation.
-
refreshStart
Called before refreshing anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()prior to refreshing.- Parameters:
ctx- The context containing information about the record operation.- See Also:
-
refreshEnd
Called after refreshing anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()after refreshing.- Parameters:
ctx- The context containing information about the record operation.- See Also:
-
exception
Called when an exception occurs.- Parameters:
ctx- The context containing information about the record operation.
-
onStoreStart
Create aRecordListenerwith aonStoreStart(Consumer)implementation. -
onStoreEnd
Create aRecordListenerwith aonStoreEnd(Consumer)implementation. -
onInsertStart
Create aRecordListenerwith aonInsertStart(Consumer)implementation. -
onInsertEnd
Create aRecordListenerwith aonInsertEnd(Consumer)implementation. -
onUpdateStart
Create aRecordListenerwith aonUpdateStart(Consumer)implementation. -
onUpdateEnd
Create aRecordListenerwith aonUpdateEnd(Consumer)implementation. -
onMergeStart
Create aRecordListenerwith aonMergeStart(Consumer)implementation. -
onMergeEnd
Create aRecordListenerwith aonMergeEnd(Consumer)implementation. -
onDeleteStart
Create aRecordListenerwith aonDeleteStart(Consumer)implementation. -
onDeleteEnd
Create aRecordListenerwith aonDeleteEnd(Consumer)implementation. -
onLoadStart
Create aRecordListenerwith aonLoadStart(Consumer)implementation. -
onLoadEnd
Create aRecordListenerwith aonLoadEnd(Consumer)implementation. -
onRefreshStart
Create aRecordListenerwith aonRefreshStart(Consumer)implementation. -
onRefreshEnd
Create aRecordListenerwith aonRefreshEnd(Consumer)implementation. -
onException
Create aRecordListenerwith aonException(Consumer)implementation.
-