org.springframework.data.relational.core.conversion

## Class RelationalEntityDeleteWriter

- java.lang.Object
- - org.springframework.data.relational.core.conversion.RelationalEntityDeleteWriter

All Implemented Interfaces:
  EntityWriter<Object,MutableAggregateChange<?>>

    public class RelationalEntityDeleteWriter
    extends Object
    implements EntityWriter<Object,MutableAggregateChange<?>>

Converts an entity that is about to be deleted into `DbAction`s inside a `MutableAggregateChange` that need to be executed against the database to recreate the appropriate state in the database. If the `MutableAggregateChange` has a reference to the entity and the entity has a version attribute, the delete will include an optimistic record locking check.

Author:
  Jens Schauder, Mark Paluch, Bastian Wilhelm, Tyler Van Gorder, Myeonghyeon Lee

### Constructor Summary

Constructors
Constructor and Description
`RelationalEntityDeleteWriter(RelationalMappingContext context)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `write(Object id, MutableAggregateChange<?> aggregateChange)` Fills the provided `MutableAggregateChange` with the necessary `DbAction`s to delete the aggregate root identified by `id`.

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

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

### Constructor Detail

#### RelationalEntityDeleteWriter

    public RelationalEntityDeleteWriter(RelationalMappingContext context)

### Method Detail

#### write

    public void write(@Nullable
                      Object id,
                      MutableAggregateChange<?> aggregateChange)

Fills the provided `MutableAggregateChange` with the necessary `DbAction`s to delete the aggregate root identified by `id`. If `id` is `null` it is interpreted as "Delete all aggregates of the type indicated by the aggregateChange".

Specified by:
  `write` in interface `EntityWriter<Object,MutableAggregateChange<?>>`
Parameters:
  `id` - may be `null`.
  `aggregateChange` - must not be `null`.