org.springframework.data.relational.core.mapping.event

## Class RelationalAuditingCallback

- java.lang.Object
- - org.springframework.data.relational.core.mapping.event.RelationalAuditingCallback

All Implemented Interfaces:
  Ordered, EntityCallback<Object>, BeforeConvertCallback<Object>

    public class RelationalAuditingCallback
    extends Object
    implements BeforeConvertCallback<Object>, Ordered

`BeforeConvertCallback` to capture auditing information on persisting and updating entities.

An instance of this class gets registered when you enable auditing for Spring Data JDBC.

Since:
  1.1
Author:
  Jens Schauder, Mark Paluch

### Field Summary

Fields
`static int` `AUDITING_ORDER` The order used for this `EventListener`.

### Fields inherited from interface org.springframework.core.Ordered

`HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

### Constructor Summary

Constructors
Constructor and Description
`RelationalAuditingCallback(IsNewAwareAuditingHandler handler)`

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `getOrder()`
`Object` `onBeforeConvert(Object entity)` Entity callback method invoked before an aggregate root is converted to be persisted.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### AUDITING_ORDER

    public static final int AUDITING_ORDER

The order used for this `EventListener`. Ordering ensures that this `ApplicationListener` will run before other listeners without a specified priority.

See Also:
  `Order`, `Ordered`, Constant Field Values

### Constructor Detail

#### RelationalAuditingCallback

    public RelationalAuditingCallback(IsNewAwareAuditingHandler handler)

### Method Detail

#### getOrder

    public int getOrder()

Specified by:
  `getOrder` in interface `Ordered`

#### onBeforeConvert

    public Object onBeforeConvert(Object entity)

Description copied from interface: `BeforeConvertCallback`
Entity callback method invoked before an aggregate root is converted to be persisted. Can return either the same or a modified instance of the aggregate.

Specified by:
  `onBeforeConvert` in interface `BeforeConvertCallback<Object>`
Parameters:
  `entity` - the saved aggregate.
Returns:
  the aggregate to be persisted.