Package jakarta.nosql

Class MappingException

All Implemented Interfaces:
Serializable

public class MappingException extends NoSQLException
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 @Entity does not have the @Id annotation.
  • A class annotated with @Entity or @Embeddable does not have a default constructor or has multiple constructors without @Id and @Column annotations.
  • A class annotated with @Entity or @Embeddable has 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 Details

    • MappingException

      public MappingException(String message, Throwable cause)
      Constructs a MappingException using the given message and cause.
      Parameters:
      message - A message explaining the exception condition
      cause - The underlying cause
    • MappingException

      public MappingException(Throwable cause)
      Constructs a MappingException using the given cause.
      Parameters:
      cause - The underlying cause
    • MappingException

      public MappingException(String message)
      Constructs a MappingException using the given message.
      Parameters:
      message - A message explaining the exception condition