Package jakarta.nosql

Annotation Interface DiscriminatorColumn


@Retention(RUNTIME) @Target(TYPE) public @interface DiscriminatorColumn
Specifies the discriminator column for the mapping strategy. If the DiscriminatorColumn annotation is missing, the name of the discriminator column defaults to "dtype".

Example usage:


 @Entity
 @DiscriminatorColumn(name = "dtype")
 public class Animal {
     // Common fields and methods for all animals
 }

 @Entity
 public class Dog extends Animal {
     // Specific fields and methods for dogs
 }

 @Entity
 public class Cat extends Animal {
     // Specific fields and methods for cats
 }
 
Since:
1.0.0
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    (Optional) The name of the column to be used for the discriminator.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The default name of the discriminator column, which is "dtype".
  • Field Details

    • DEFAULT_DISCRIMINATOR_COLUMN

      static final String DEFAULT_DISCRIMINATOR_COLUMN
      The default name of the discriminator column, which is "dtype".
      See Also:
  • Element Details

    • value

      String value
      (Optional) The name of the column to be used for the discriminator.
      Returns:
      the column's name
      Default:
      "dtype"