Class DefaultDefaultValueStrategy
java.lang.Object
de.yamass.redg.runtime.defaultvalues.DefaultDefaultValueStrategy
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> T
getDefaultValue
(ColumnModel columnModel, Class<T> type) Generates and returns a default value for a column in a table.
-
Constructor Details
-
DefaultDefaultValueStrategy
public DefaultDefaultValueStrategy()
-
-
Method Details
-
getDefaultValue
Description copied from interface:DefaultValueStrategy
Generates and returns a default value for a column in a table.- Specified by:
getDefaultValue
in interfaceDefaultValueStrategy
- 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 valuetype
- the required class- Returns:
- The default value for the field.
null
is allowed ifnotNull == false
. This is not checked anywhere
-