public class BeforeSaveEvent<E> extends RelationalSaveEvent<E>
ApplicationEvent that gets triggered before changes are applied to the database, after the aggregate was
converted to a database change.
Changes to the aggregate are not taken into account to decide whether the change will be an insert or update. Use the
BeforeConvertCallback to change the persistent the entity before being converted.
Currently a BeforeSaveEvent may be used to create an Id for new aggregate roots. This is for backward
compatibility purposes within the 2.x development line. The preferred way to do this is to use a
BeforeConvertCallback or BeforeConvertEvent and beginning with 3.0. this will be the only correct way
to do this.
source| Constructor and Description |
|---|
BeforeSaveEvent(E instance,
AggregateChange<E> change) |
getAggregateChangegetEntity, getTypegetTimestampgetSource, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetEntity, getTypepublic BeforeSaveEvent(E instance, AggregateChange<E> change)
instance - the entity about to get saved. Must not be null.change - the AggregateChange that is going to get applied to the database. Must not be
null.Copyright © 2017–2023 Pivotal Software, Inc.. All rights reserved.