Class DefaultDefaultValueStrategy

java.lang.Object
de.yamass.redg.runtime.defaultvalues.DefaultDefaultValueStrategy
All Implemented Interfaces:
DefaultValueStrategy

public class DefaultDefaultValueStrategy extends Object implements DefaultValueStrategy
A simple default value strategy, returning empty or 0 values for the most common data types. If the field is nullable, null is returned.

Supported types:

  • String
  • everything extending Number
  • everything extending java.util.Date
  • Boolean
  • Constructor Details

    • DefaultDefaultValueStrategy

      public DefaultDefaultValueStrategy()
  • Method Details

    • getDefaultValue

      public <T> T getDefaultValue(ColumnModel columnModel, Class<T> type)
      Description copied from interface: DefaultValueStrategy
      Generates and returns a default value for a column in a table.
      Specified by:
      getDefaultValue in interface DefaultValueStrategy
      Type Parameters:
      T - The type of the field that needs a default value
      Parameters:
      columnModel - The complete column model of the column that needs a default value
      type - the required class
      Returns:
      The default value for the field. null is allowed if notNull == false. This is not checked anywhere