For the latest stable version, please use Spring Data Relational 3.4.0!

EntityCallbacks

Spring Data R2DBC uses the EntityCallback API for its auditing support and reacts on the following callbacks.

Table 1. Supported Entity Callbacks
Callback Method Description Order

BeforeConvertCallback

onBeforeConvert(T entity, SqlIdentifier table)

Invoked before a domain object is converted to OutboundRow.

Ordered.LOWEST_PRECEDENCE

AfterConvertCallback

onAfterConvert(T entity, SqlIdentifier table)

Invoked after a domain object is loaded.
Can modify the domain object after reading it from a row.

Ordered.LOWEST_PRECEDENCE

AuditingEntityCallback

onBeforeConvert(T entity, SqlIdentifier table)

Marks an auditable entity created or modified

100

BeforeSaveCallback

onBeforeSave(T entity, OutboundRow row, SqlIdentifier table)

Invoked before a domain object is saved.
Can modify the target, to be persisted, OutboundRow containing all mapped entity information.

Ordered.LOWEST_PRECEDENCE

AfterSaveCallback

onAfterSave(T entity, OutboundRow row, SqlIdentifier table)

Invoked after a domain object is saved.
Can modify the domain object, to be returned after save, OutboundRow containing all mapped entity information.

Ordered.LOWEST_PRECEDENCE