Annotation Type DefaultIfNull


@Target(FIELD)
@Retention(RUNTIME)
public @interface DefaultIfNull
This annotation tells Java2DB to use the database-default for a column if the corresponding Java field marked with this annotation is null.
Author:
Collin Alpert
  • Optional Element Summary

    Optional Elements 
    Modifier and Type Optional Element Description
    boolean onCreate
    Configures, if the database-default should be used in a create statement when the field is null.
    boolean onUpdate
    Configures, if the database-default should be used in an update statement when the field is null.
  • Element Details

    • onCreate

      boolean onCreate
      Configures, if the database-default should be used in a create statement when the field is null. Per default, this is enabled.
      Returns:
      True, if the database-default should be used in create statements, false if null should be written into the database when the field is also null.
      Default:
      true
    • onUpdate

      boolean onUpdate
      Configures, if the database-default should be used in an update statement when the field is null. Per default, this is not enabled.
      Returns:
      True, if the database-default should be used in update statements, false if null should be written into the database when the field is also null.
      Default:
      false