Package ch.autumo.commons.database
Class DBField
java.lang.Object
ch.autumo.commons.database.DBField
DB field.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOGLogger.
-
-
Constructor Details
-
DBField
Constructor.- Parameters:
name
- column nametype
- column typeisNullable
- is nullable?unique
- is unique?defaultVal
- column default value
-
-
Method Details
-
getDefaultVal
Get default value.- Returns:
- default value
-
getName
Get column name.- Returns:
- column name
-
getType
Get column type.- Returns:
- column type
-
isUnique
public boolean isUnique()Unique?- Returns:
- true if so
-
isNullable
public boolean isNullable()Nullable?- Returns:
- true if so
-
toString
-
serialize
Serialize this field to JSON.- Parameters:
field
- field- Returns:
- JSON string
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
- if field cannot be serialized to JSON
-