Class ColumnDefinition

java.lang.Object
com.github.tadukoo.database.mysql.syntax.ColumnDefinition

public class ColumnDefinition extends Object
Column Definition is a definition for a column in MySQL.
Version:
Alpha v.0.3
Author:
Logan Ferree (Tadukoo)
  • Field Details

    • columnName

      private final String columnName
      The name to use for the column
    • dataType

      private final SQLDataType dataType
      The data type of the column
    • size

      private final Long size
      The length of the column or total number of digits
    • values

      private final List<String> values
      The possible values for the column
    • digits

      private final Integer digits
      The number of digits after the decimal
    • fractionalSecondsPrecision

      private final Integer fractionalSecondsPrecision
      The precision for fractional seconds
    • notNull

      private final boolean notNull
      Whether this column allows null (false) or not (true)
    • unsigned

      private final boolean unsigned
      Whether this column is unsigned (true) or signed (false)
    • autoIncrement

      private final boolean autoIncrement
      Whether to auto-increment this column or not
    • primaryKey

      private final boolean primaryKey
      Whether this column is the primary key or not
  • Constructor Details

    • ColumnDefinition

      private ColumnDefinition(String columnName, SQLDataType dataType, Long size, List<String> values, Integer digits, Integer fractionalSecondsPrecision, boolean notNull, boolean unsigned, boolean autoIncrement, boolean primaryKey)
      Constructs a new ColumnDefinition with the given parameters
      Parameters:
      columnName - The name to use for the column
      dataType - The data type of the column
      size - The length of the column or total number of digits
      values - The possible values for the column
      digits - The number of digits after the decimal
      fractionalSecondsPrecision - The precision for fractional seconds
      notNull - Whether this column allows null (false) or not (true)
      unsigned - Whether this column is unsigned (true) or signed (false)
      autoIncrement - Whether to auto-increment this column or not
      primaryKey - Whether this column is the primary key or not
  • Method Details

    • builder

      public static ColumnDefinition.ColumnName builder()
      Returns:
      A new builder to build a new ColumnDefinition
    • getColumnName

      public String getColumnName()
      Returns:
      The name to use for the column
    • getDataType

      public SQLDataType getDataType()
      Returns:
      The data type of the column
    • getSize

      public Long getSize()
      Returns:
      The length of the column or total number of digits
    • getValues

      public List<String> getValues()
      Returns:
      The possible values for the column
    • getDigits

      public Integer getDigits()
      Returns:
      The number of digits after the decimal
    • getFractionalSecondsPrecision

      public Integer getFractionalSecondsPrecision()
      Returns:
      The precision for fractional seconds
    • isNotNull

      public boolean isNotNull()
      Returns:
      Whether this column allows null (false) or not (true)
    • isUnsigned

      public boolean isUnsigned()
      Returns:
      Whether this column is unsigned (true) or signed (false)
    • isAutoIncremented

      public boolean isAutoIncremented()
      Returns:
      Whether to auto-increment this column or not
    • isPrimaryKey

      public boolean isPrimaryKey()
      Returns:
      Whether this column is the primary key or not
    • toString

      public String toString()
      Overrides:
      toString in class Object