Package org.axonframework.modelling
Class LoadedEntityNotOfExpectedTypeException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.axonframework.modelling.LoadedEntityNotOfExpectedTypeException
- All Implemented Interfaces:
Serializable
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 Summary
ConstructorsConstructorDescriptionLoadedEntityNotOfExpectedTypeException(Class<?> entityType, Class<?> expectedType) Initialize the exception with a message containing entity type that was loaded and the type that was expected. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
LoadedEntityNotOfExpectedTypeException
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.
-