Package st.orm

Annotation Interface DbIgnore


@Target({TYPE,RECORD_COMPONENT,PARAMETER}) @Retention(RUNTIME) public @interface DbIgnore
Suppresses schema validation for the annotated entity type or record component.

When placed on an entity type, all schema validation checks are skipped for that entity. When placed on a record component, validation checks for the corresponding column (or columns, in the case of inline records) are skipped.

Example usage:


 // Suppress all schema validation for a legacy entity.
 @DbIgnore
 record LegacyUser(@PK Integer id, String name) implements Entity<Integer> {}

 // Suppress schema validation for a specific field.
 record User(
     @PK Integer id,
     @DbIgnore("DB uses FLOAT, but column only stores whole numbers")
     Integer age
 ) implements Entity<Integer> {}
 
Since:
1.9
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Optional reason for ignoring schema validation.
  • Element Details

    • value

      String value
      Optional reason for ignoring schema validation.

      Documents why the mismatch is acceptable, for example:

      
       @DbIgnore("DB uses FLOAT, but column only stores whole numbers")
       Integer age
       
      Default:
      ""