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
-
Element Details
-
onCreate
boolean onCreateConfigures, if the database-default should be used in a create statement when the field isnull. Per default, this is enabled.- Returns:
True, if the database-default should be used in create statements,falseifnullshould be written into the database when the field is alsonull.
- Default:
- true
-
onUpdate
boolean onUpdateConfigures, if the database-default should be used in an update statement when the field isnull. Per default, this is not enabled.- Returns:
True, if the database-default should be used in update statements,falseifnullshould be written into the database when the field is alsonull.
- Default:
- false
-