Class PropertyBasedEntityIdResolver

java.lang.Object
org.axonframework.modelling.PropertyBasedEntityIdResolver
All Implemented Interfaces:
EntityIdResolver<Object>

public class PropertyBasedEntityIdResolver extends Object implements EntityIdResolver<Object>
Implementation of a EntityIdResolver that inspects the payload of a Message for an identifier.

The identifier is resolved by looking for a field or method with the given property name. Methods will automatically be resolved by looking for a method with the name get<Property> or <Property>.

This field or method needs to have or return a non-null value. If a null value is found, a EntityIdResolutionException is thrown. If no member is found at all, a TargetEntityIdMemberMismatchException is thrown.

Since:
5.0.0
Author:
Mitchell Herrijgers
  • Constructor Details

    • PropertyBasedEntityIdResolver

      public PropertyBasedEntityIdResolver(@Nonnull String property)
      Initialize the resolver with the given property name.
      Parameters:
      property - The name of the property to resolve the identifier from.
  • Method Details