java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
jakarta.nosql.NoSQLException
jakarta.nosql.MappingException
- All Implemented Interfaces:
Serializable
An exception that occurs when there is a mapping error during entity mapping or persistence.
This exception typically indicates issues with the usage or missing annotations at the entity level.
Some scenarios where this exception may be thrown include:
- A class annotated with
@Entitydoes not have the@Idannotation. - A class annotated with
@Entityor@Embeddabledoes not have a default constructor or has multiple constructors without@Idand@Columnannotations. - A class annotated with
@Entityor@Embeddablehas multiple constructors with annotations provided by Jakarta NoSQL, which may lead to ambiguity in entity instantiation.
This exception may occur at runtime or build time, depending on the Jakarta NoSQL provider being used.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMappingException(String message) Constructs aMappingExceptionusing the given message.MappingException(String message, Throwable cause) Constructs aMappingExceptionusing the given message and cause.MappingException(Throwable cause) Constructs aMappingExceptionusing the given cause. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
MappingException
Constructs aMappingExceptionusing the given message and cause.- Parameters:
message- A message explaining the exception conditioncause- The underlying cause
-
MappingException
Constructs aMappingExceptionusing the given cause.- Parameters:
cause- The underlying cause
-
MappingException
Constructs aMappingExceptionusing the given message.- Parameters:
message- A message explaining the exception condition
-