Class SingleEntityChildMetamodel<C,P>
java.lang.Object
org.axonframework.modelling.entity.child.AbstractEntityChildMetamodel<C,P>
org.axonframework.modelling.entity.child.SingleEntityChildMetamodel<C,P>
- Type Parameters:
C- The type of the child entity.P- The type of the parent entity.
- All Implemented Interfaces:
EntityChildMetamodel<C,,P> EntityEvolver<P>
An
EntityChildMetamodel that handles commands and events for a single child entity. It will use the provided
ChildEntityFieldDefinition to resolve the child entity from the parent entity. Once the entity is resolved,
it will delegate the command- and event-handling to the child entity metamodel.
The commands and events will, by default, be forwarded unconditionally to the child entity. If you have multiple
member fields, and want to match commands and events to a specific child entity, you can configure the
CommandTargetResolver and EventTargetMatcher to match the child entity based on the command or
event.
- Since:
- 5.0.0
- Author:
- Mitchell Herrijgers
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for creating aSingleEntityChildMetamodelfor the given parent class and child entity metamodel. -
Field Summary
Fields inherited from class org.axonframework.modelling.entity.child.AbstractEntityChildMetamodel
commandTargetResolver, eventTargetMatcher, metamodel -
Method Summary
Modifier and TypeMethodDescriptionprotected PapplyEvolvedChildEntities(P entity, List<C> evolvedChildEntities) Returns theEntityMetamodelof the child entity this metamodel describes.static <C,P> SingleEntityChildMetamodel.Builder <C, P> forEntityModel(Class<P> parentClass, EntityMetamodel<C> metamodel) Creates a newSingleEntityChildMetamodel.Builderfor the given parent class and child entity metamodel.getChildEntities(P entity) toString()Methods inherited from class org.axonframework.modelling.entity.child.AbstractEntityChildMetamodel
canHandle, entityType, evolve, handle, supportedCommands
-
Method Details
-
getChildEntities
- Specified by:
getChildEntitiesin classAbstractEntityChildMetamodel<C,P>
-
applyEvolvedChildEntities
- Specified by:
applyEvolvedChildEntitiesin classAbstractEntityChildMetamodel<C,P>
-
entityMetamodel
Description copied from interface:EntityChildMetamodelReturns theEntityMetamodelof the child entity this metamodel describes.- Returns:
- The
EntityMetamodelof the child entity this metamodel describes.
-
toString
-
forEntityModel
public static <C,P> SingleEntityChildMetamodel.Builder<C,P> forEntityModel(@Nonnull Class<P> parentClass, @Nonnull EntityMetamodel<C> metamodel) Creates a newSingleEntityChildMetamodel.Builderfor the given parent class and child entity metamodel. TheChildEntityFieldDefinitionis required to resolve the child entity from the parent entity and evolve the parent entity based on the child entities.- Type Parameters:
C- The type of the child entity.P- The type of the parent entity.- Parameters:
parentClass- The class of the parent entity.metamodel- TheEntityMetamodelof the child entity.- Returns:
- A new
SingleEntityChildMetamodel.Builderfor the given parent class and child entity metamodel.
-