Enum SqlType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<SqlType>

    public enum SqlType
    extends java.lang.Enum<SqlType>
    The sql types used by tentackle.

    Defines a typesafe subset of Types.

    Author:
    harald
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getDefaultValue()
      Gets the default value.
      boolean isFractional()
      Returns whether numeric fractional type.
      boolean isNumeric()
      Returns whether numeric type.
      java.lang.Object parse​(java.lang.String str)
      Parses the string and converts to a java-value.
      static SqlType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static SqlType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • 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.
      • JAVA_OBJECT

        public static final SqlType JAVA_OBJECT
        Application specific.
    • Method Detail

      • values

        public static SqlType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (SqlType c : SqlType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static SqlType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • isNumeric

        public boolean isNumeric()
        Returns whether numeric type.
        Returns:
        true if numeric
      • isFractional

        public boolean isFractional()
        Returns whether numeric fractional type.
        Returns:
        true if fractional
      • getDefaultValue

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

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