Annotation Interface ComputedColumn


@Target(FIELD) @Retention(RUNTIME) @Documented public @interface ComputedColumn
Marks a field as a CockroachDB computed (generated) column. CockroachDB requires computed columns to be STORED.

 @ComputedColumn(expression = "price * quantity")
 private Integer total;
 
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    SQL expression for the computed column.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether the column is stored.
  • Element Details

    • expression

      String expression
      SQL expression for the computed column.
    • stored

      boolean stored
      Whether the column is stored. CockroachDB requires true.
      Default:
      true