Package org.salespointframework.core
Class AbstractAggregateRoot<ID extends org.jmolecules.ddd.types.Identifier>
java.lang.Object
org.salespointframework.core.AbstractEntity<ID>
org.salespointframework.core.AbstractAggregateRoot<ID>
- All Implemented Interfaces:
Persistable<ID>
- Direct Known Subclasses:
AccountancyEntry
,InventoryItem
,Order
,Product
,UserAccount
@MappedSuperclass
public abstract class AbstractAggregateRoot<ID extends org.jmolecules.ddd.types.Identifier>
extends AbstractEntity<ID>
Base class for Aggregate root entities. It exposes a
registerEvent(Object)
method that allows sub-classes to
register events to be published as soon as the aggregates are persisted using calls to
CrudRepository.save(Object)
.- Since:
- 7.3
- Author:
- Oliver Drotbohm
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected final <T> T
registerEvent
(T event) Registers the given event with the aggregate root for publication on persisting, i.e.Methods inherited from class org.salespointframework.core.AbstractEntity
equals, hashCode, hasId, isNew
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.domain.Persistable
getId
-
Constructor Details
-
AbstractAggregateRoot
public AbstractAggregateRoot()
-
-
Method Details
-
registerEvent
protected final <T> T registerEvent(T event) Registers the given event with the aggregate root for publication on persisting, i.e.CrudRepository.save(Object)
.- Type Parameters:
T
- the type of the event- Parameters:
event
- must not be null.- Returns:
-