Class DBField

java.lang.Object
ch.autumo.commons.database.DBField

public class DBField extends Object
DB field.
  • Field Details

    • LOG

      protected static final org.slf4j.Logger LOG
      Logger.
  • Constructor Details

    • DBField

      public DBField(String name, String type, boolean isNullable, boolean unique, String defaultVal)
      Constructor.
      Parameters:
      name - column name
      type - column type
      isNullable - is nullable?
      unique - is unique?
      defaultVal - column default value
  • Method Details

    • getDefaultVal

      public String getDefaultVal()
      Get default value.
      Returns:
      default value
    • getName

      public String getName()
      Get column name.
      Returns:
      column name
    • getType

      public String 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

      public String toString()
      Overrides:
      toString in class Object
    • serialize

      public String serialize(DBField field) throws com.fasterxml.jackson.core.JsonProcessingException
      Serialize this field to JSON.
      Parameters:
      field - field
      Returns:
      JSON string
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - if field cannot be serialized to JSON