Class BeforeConvertEvent<E>

All Implemented Interfaces:
Serializable, RelationalEvent<E>, WithEntity<E>

public class BeforeConvertEvent<E> extends RelationalEventWithEntity<E>
Gets published before an aggregate gets converted into a database change, but after the decision was made if an insert or an update is to be performed.

The persisting process works as follows:

  1. A decision is made, if the aggregate is new and therefore should be inserted or if it is not new and therefore should be updated.
  2. BeforeConvertCallback and BeforeConvertEvent get published.
  3. An AggregateChange object is created for the aggregate. It includes the DbAction instances to be executed. This means that all the deletes, updates and inserts to be performed are determined. These actions reference entities of the aggregates in order to access values to be used in the SQL statements. This step also determines if the id of an entity gets passed to the database or if the database is expected to generate that id.
  4. BeforeSaveCallback and BeforeSaveEvent get published.
  5. SQL statements get applied to the database.
  6. AfterSaveCallback and AfterSaveEvent get published.
Since:
1.1
Author:
Jens Schauder, Mark Paluch
See Also:
  • Constructor Details

    • BeforeConvertEvent

      public BeforeConvertEvent(E instance)
      Parameters:
      instance - the saved entity. Must not be null.
      Since:
      2.1.4