- 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 TypeMethodDescriptionvoiddeleteEnd(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.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.voidrefreshEnd(RecordContext ctx) Called after refreshing anUpdatableRecord.voidCalled 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 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.- 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.- See Also:
-
insertStart
Called before inserting anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()prior to inserting.- See Also:
-
insertEnd
Called after inserting anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()after inserting.- See Also:
-
updateStart
Called before updating anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()prior to updating.- See Also:
-
updateEnd
Called after updating anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()after updating.- See Also:
-
mergeStart
Called before merging anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()prior to merging.- See Also:
-
mergeEnd
Called after merging anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()after merging.- See Also:
-
deleteStart
Called before deleting anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()prior to deleting.- See Also:
-
deleteEnd
Called after deleting anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()after deleting.- See Also:
-
loadStart
Called before loading anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()prior to loading. -
loadEnd
Called after loading anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()after loading. -
refreshStart
Called before refreshing anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()prior to refreshing.- See Also:
-
refreshEnd
Called after refreshing anUpdatableRecord.Implementations are allowed to modify
RecordContext.record()after refreshing.- See Also:
-
exception
Called when an exception occurs. -
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.
-