Class AnnotatedEntityMetamodel<E>

java.lang.Object
org.axonframework.modelling.entity.annotation.AnnotatedEntityMetamodel<E>
Type Parameters:
E - The type of entity this metamodel describes.
All Implemented Interfaces:
DescribableComponent, EntityMetamodel<E>, EntityEvolver<E>

public class AnnotatedEntityMetamodel<E> extends Object implements EntityMetamodel<E>, DescribableComponent
An EntityMetamodel implementation that uses reflection to inspect the entity. It will detect annotated command- and event-handling methods, as well as child entities annotated with EntityMember. Everything that is discovered is then registered to a delegate EntityMetamodel, so that essentially a declared metamodel is built of which it's structure is clearly defined.

Besides normal EntityMetamodel operations, this metamodel also provides a means to get the expected representation of a command or event handler based on the QualifiedName of the message type. This is useful for determining the payload type of a command or event handler when multiple handlers are present for the same message type.

NOTE: This class is a complete rewrite of the pre-5.0.0 org.axonframework.modelling.command.inspection.AnnotatedAggregateMetaModelFactory. Both scan the class for annotated methods and fields, but the AnnotatedEntityModel dropped aggregate versioning (conflict resolution), no longer required an id in the entity, and creates a declarative metamodel instead of relying on reflection at runtime.

Since:
3.1.0
Author:
Mitchell Herrijgers, Allard Buijze