-
- All Superinterfaces:
EventListener
- All Known Implementing Classes:
DefaultRecordListener
public interface RecordListener extends EventListener
A listener for manipulation events onUpdatableRecord
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. 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 aVisitListener
if 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 void
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
.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 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 anINSERT
orUPDATE
statement.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 anINSERT
orUPDATE
statement.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.
-
-