Class LoadedEntityNotOfExpectedTypeException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.axonframework.modelling.LoadedEntityNotOfExpectedTypeException
All Implemented Interfaces:
Serializable

public class LoadedEntityNotOfExpectedTypeException extends RuntimeException
Exception thrown by the StateManager when the loaded entity from the Repository is not assignable to the expected type. This can happen when the entity is loaded from a repository that is not parameterized correctly, or when a subclass of an entity was attempted to be loaded and the repository returns a less specific type.
Since:
5.0.0
Author:
Mitchell Herrijgers
See Also:
  • Constructor Details

    • LoadedEntityNotOfExpectedTypeException

      public LoadedEntityNotOfExpectedTypeException(Class<?> entityType, Class<?> expectedType)
      Initialize the exception with a message containing entity type that was loaded and the type that was expected.
      Parameters:
      entityType - The type of the entity that was loaded and is not assignable to the expected type.
      expectedType - The type that was expected.