- All Superinterfaces:
EventListener
- All Known Implementing Classes:
CallbackRecordListener
,DefaultRecordListener
UpdatableRecord
s.
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 TypeMethodDescriptionvoid
deleteEnd(RecordContext ctx)
Called after deleting anUpdatableRecord
.void
deleteStart(RecordContext ctx)
Called before deleting anUpdatableRecord
.void
exception(RecordContext ctx)
Called when an exception occurs.void
insertEnd(RecordContext ctx)
Called after inserting anUpdatableRecord
.void
insertStart(RecordContext ctx)
Called before inserting anUpdatableRecord
.void
loadEnd(RecordContext ctx)
Called after loading anUpdatableRecord
.void
loadStart(RecordContext ctx)
Called before loading anUpdatableRecord
.void
mergeEnd(RecordContext ctx)
Called after merging anUpdatableRecord
.void
mergeStart(RecordContext ctx)
Called before merging anUpdatableRecord
.static CallbackRecordListener
onDeleteEnd(Consumer<? super RecordContext> onDeleteEnd)
Create aRecordListener
with aonDeleteEnd(Consumer)
implementation.static CallbackRecordListener
onDeleteStart(Consumer<? super RecordContext> onDeleteStart)
Create aRecordListener
with aonDeleteStart(Consumer)
implementation.static CallbackRecordListener
onException(Consumer<? super RecordContext> onException)
Create aRecordListener
with aonException(Consumer)
implementation.static CallbackRecordListener
onInsertEnd(Consumer<? super RecordContext> onInsertEnd)
Create aRecordListener
with aonInsertEnd(Consumer)
implementation.static CallbackRecordListener
onInsertStart(Consumer<? super RecordContext> onInsertStart)
Create aRecordListener
with aonInsertStart(Consumer)
implementation.static CallbackRecordListener
onLoadEnd(Consumer<? super RecordContext> onLoadEnd)
Create aRecordListener
with aonLoadEnd(Consumer)
implementation.static CallbackRecordListener
onLoadStart(Consumer<? super RecordContext> onLoadStart)
Create aRecordListener
with aonLoadStart(Consumer)
implementation.static CallbackRecordListener
onMergeEnd(Consumer<? super RecordContext> onMergeEnd)
Create aRecordListener
with aonMergeEnd(Consumer)
implementation.static CallbackRecordListener
onMergeStart(Consumer<? super RecordContext> onMergeStart)
Create aRecordListener
with aonMergeStart(Consumer)
implementation.static CallbackRecordListener
onRefreshEnd(Consumer<? super RecordContext> onRefreshEnd)
Create aRecordListener
with aonRefreshEnd(Consumer)
implementation.static CallbackRecordListener
onRefreshStart(Consumer<? super RecordContext> onRefreshStart)
Create aRecordListener
with aonRefreshStart(Consumer)
implementation.static CallbackRecordListener
onStoreEnd(Consumer<? super RecordContext> onStoreEnd)
Create aRecordListener
with aonStoreEnd(Consumer)
implementation.static CallbackRecordListener
onStoreStart(Consumer<? super RecordContext> onStoreStart)
Create aRecordListener
with aonStoreStart(Consumer)
implementation.static CallbackRecordListener
onUpdateEnd(Consumer<? super RecordContext> onUpdateEnd)
Create aRecordListener
with aonUpdateEnd(Consumer)
implementation.static CallbackRecordListener
onUpdateStart(Consumer<? super RecordContext> onUpdateStart)
Create aRecordListener
with aonUpdateStart(Consumer)
implementation.void
refreshEnd(RecordContext ctx)
Called after refreshing anUpdatableRecord
.void
refreshStart(RecordContext ctx)
Called before refreshing anUpdatableRecord
.void
storeEnd(RecordContext ctx)
Called after storing anUpdatableRecord
.void
storeStart(RecordContext ctx)
Called before storing anUpdatableRecord
.void
updateEnd(RecordContext ctx)
Called after updating anUpdatableRecord
.void
updateStart(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 anINSERT
orUPDATE
statement.A store event will generate a nested
insertStart(RecordContext)
orupdateStart(RecordContext)
event.- See Also:
UpdatableRecord.store()
-
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 anINSERT
orUPDATE
statement.A store event will generate a nested
insertEnd(RecordContext)
orupdateEnd(RecordContext)
event.- See Also:
UpdatableRecord.store()
-
insertStart
Called before inserting anUpdatableRecord
.Implementations are allowed to modify
RecordContext.record()
prior to inserting.- See Also:
UpdatableRecord.insert()
-
insertEnd
Called after inserting anUpdatableRecord
.Implementations are allowed to modify
RecordContext.record()
after inserting.- See Also:
UpdatableRecord.insert()
-
updateStart
Called before updating anUpdatableRecord
.Implementations are allowed to modify
RecordContext.record()
prior to updating.- See Also:
UpdatableRecord.update()
-
updateEnd
Called after updating anUpdatableRecord
.Implementations are allowed to modify
RecordContext.record()
after updating.- See Also:
UpdatableRecord.update()
-
mergeStart
Called before merging anUpdatableRecord
.Implementations are allowed to modify
RecordContext.record()
prior to merging.- See Also:
UpdatableRecord.merge()
-
mergeEnd
Called after merging anUpdatableRecord
.Implementations are allowed to modify
RecordContext.record()
after merging.- See Also:
UpdatableRecord.merge()
-
deleteStart
Called before deleting anUpdatableRecord
.Implementations are allowed to modify
RecordContext.record()
prior to deleting.- See Also:
UpdatableRecord.delete()
-
deleteEnd
Called after deleting anUpdatableRecord
.Implementations are allowed to modify
RecordContext.record()
after deleting.- See Also:
UpdatableRecord.delete()
-
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:
UpdatableRecord.refresh()
-
refreshEnd
Called after refreshing anUpdatableRecord
.Implementations are allowed to modify
RecordContext.record()
after refreshing.- See Also:
UpdatableRecord.refresh()
-
exception
Called when an exception occurs. -
onStoreStart
Create aRecordListener
with aonStoreStart(Consumer)
implementation. -
onStoreEnd
Create aRecordListener
with aonStoreEnd(Consumer)
implementation. -
onInsertStart
Create aRecordListener
with aonInsertStart(Consumer)
implementation. -
onInsertEnd
Create aRecordListener
with aonInsertEnd(Consumer)
implementation. -
onUpdateStart
Create aRecordListener
with aonUpdateStart(Consumer)
implementation. -
onUpdateEnd
Create aRecordListener
with aonUpdateEnd(Consumer)
implementation. -
onMergeStart
Create aRecordListener
with aonMergeStart(Consumer)
implementation. -
onMergeEnd
Create aRecordListener
with aonMergeEnd(Consumer)
implementation. -
onDeleteStart
Create aRecordListener
with aonDeleteStart(Consumer)
implementation. -
onDeleteEnd
Create aRecordListener
with aonDeleteEnd(Consumer)
implementation. -
onLoadStart
Create aRecordListener
with aonLoadStart(Consumer)
implementation. -
onLoadEnd
Create aRecordListener
with aonLoadEnd(Consumer)
implementation. -
onRefreshStart
Create aRecordListener
with aonRefreshStart(Consumer)
implementation. -
onRefreshEnd
Create aRecordListener
with aonRefreshEnd(Consumer)
implementation. -
onException
Create aRecordListener
with aonException(Consumer)
implementation.
-