Enum Class SqlType

java.lang.Object
java.lang.Enum<SqlType>
org.tentackle.sql.SqlType
All Implemented Interfaces:
Serializable, Comparable<SqlType>, Constable

public enum SqlType extends Enum<SqlType>
The sql types used when talking to the database backend.

Defines a typesafe subset of Types.

Author:
harald
  • Enum Constant Details

    • VARCHAR

      public static final SqlType VARCHAR
      String.
    • DATE

      public static final SqlType DATE
      Date.
    • TIME

      public static final SqlType TIME
      Time.
    • TIMESTAMP

      public static final SqlType TIMESTAMP
      Timestamp.
    • BLOB

      public static final SqlType BLOB
      Arbitrary data usually stored as BLOB.
    • CLOB

      public static final SqlType CLOB
      Large Strings usually stored as CLOB.
    • DECIMAL

      public static final SqlType DECIMAL
      BigDecimal and DMoney.
    • CHAR

      public static final SqlType CHAR
      Character and char.
    • BIT

      public static final SqlType BIT
      Boolean and boolean.
    • TINYINT

      public static final SqlType TINYINT
      Byte and byte.
    • SMALLINT

      public static final SqlType SMALLINT
      Short and short.
    • INTEGER

      public static final SqlType INTEGER
      Integer and int.
    • BIGINT

      public static final SqlType BIGINT
      Long and long.
    • FLOAT

      public static final SqlType FLOAT
      Float and float.
    • DOUBLE

      public static final SqlType DOUBLE
      Double and double.
    • UUID

      public static final SqlType UUID
      UUID.
    • JAVA_OBJECT

      public static final SqlType JAVA_OBJECT
      Application specific.
  • Method Details

    • values

      public static SqlType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SqlType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getClazz

      public Class<?> getClazz()
      Gets the corresponding class.
      Returns:
      the class
    • getDefaultValue

      public Object getDefaultValue()
      Gets the default value.
      Returns:
      the default, null if no default
    • parse

      public Object parse(String str)
      Parses the string and converts to a java-value.
      Parameters:
      str - the string usually returned from JDBC metadata
      Returns:
      the java value