Annotation Interface DbField


@Retention(RUNTIME) public @interface DbField
An annotation to mark a field as a database field. This annotation is not required. It is only used to provide additional information to Stormify.

If the name of the field is camel case, it will be converted to snake case.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether the field can be used when creating a new record.
    The name of the field in the database.
    boolean
    Whether the field is a primary key.
    The name of the primary key sequence in the database.
    boolean
    Whether the field can be used when updating a record.
  • Element Details

    • name

      String name
      The name of the field in the database. If not provided, the name of the field in the class will be used.
      Returns:
      The name of the field in the database.
      Default:
      ""
    • primaryKey

      boolean primaryKey
      Whether the field is a primary key.
      Returns:
      true if the field is a primary key, false otherwise.
      Default:
      false
    • primarySequence

      String primarySequence
      The name of the primary key sequence in the database. If not provided, no sequence will be used, and will rely on the database to generate the value of the primary key.
      Returns:
      The name of the primary key sequence in the database.
      Default:
      ""
    • creatable

      boolean creatable
      Whether the field can be used when creating a new record. This is useful when more than one Java field has the same database field name, to distinguish which field will be used.

      The default value is true.

      Returns:
      true if the field can be used when creating a new record, false otherwise.
      Default:
      true
    • updatable

      boolean updatable
      Whether the field can be used when updating a record. This is useful when more than one Java field has the same database field name, to distinguish which field will be used.

      The default value is true.

      Returns:
      true if the field can be used when updating a record, false otherwise.
      Default:
      true