Class DataTypeUtils

java.lang.Object
org.eclipse.dirigible.database.sql.DataTypeUtils

public class DataTypeUtils extends Object
The Class DataTypeUtils.
  • Field Details

    • VARCHAR_DEFAULT_LENGTH

      public static final int VARCHAR_DEFAULT_LENGTH
      The default length.
      See Also:
    • DECIMAL_DEFAULT_LENGTH

      public static final int DECIMAL_DEFAULT_LENGTH
      The Constant DECIMAL_DEFAULT_LENGTH.
      See Also:
  • Constructor Details

    • DataTypeUtils

      public DataTypeUtils()
  • Method Details

    • getDatabaseType

      public static DataType getDatabaseType(Integer type)
      Gets the database type.
      Parameters:
      type - the type
      Returns:
      the database type
    • isDatabaseTypeSupported

      public static boolean isDatabaseTypeSupported(Integer type)
      Checks if is database type supported.
      Parameters:
      type - the type
      Returns:
      true, if is database type supported
    • getJavaTypeByDatabaseType

      public static Class getJavaTypeByDatabaseType(Integer type)
      Gets the java type by database type.
      Parameters:
      type - the type
      Returns:
      the java type by database type
    • getSqlTypeByDataType

      public static Integer getSqlTypeByDataType(String type)
      Gets the sql type by data type.
      Parameters:
      type - the type
      Returns:
      the sql type by data type
    • getDatabaseTypeNameByJavaType

      public static String getDatabaseTypeNameByJavaType(Class clazz)
      Gets the database type name by java type.
      Parameters:
      clazz - the clazz
      Returns:
      the database type name by java type
    • getDatabaseTypeName

      public static String getDatabaseTypeName(Integer type)
      Gets the database type name.
      Parameters:
      type - the type
      Returns:
      the database type name
    • getDatabaseTypeByJavaType

      public static Integer getDatabaseTypeByJavaType(Class clazz)
      Gets the database type by java type.
      Parameters:
      clazz - the clazz
      Returns:
      the database type by java type
    • getUnifiedDatabaseType

      public static String getUnifiedDatabaseType(String type)
      Gets the unified database type.
      Parameters:
      type - the type
      Returns:
      the unified database type
    • isBlob

      public static boolean isBlob(String dataType)
      Checks if is blob.
      Parameters:
      dataType - the data type
      Returns:
      true, if is blob
    • isBoolean

      public static boolean isBoolean(String dataType)
      Checks if is boolean.
      Parameters:
      dataType - the data type
      Returns:
      true, if is boolean
    • isDouble

      public static boolean isDouble(String dataType)
      Checks if is double.
      Parameters:
      dataType - the data type
      Returns:
      true, if is double
    • isReal

      public static boolean isReal(String dataType)
      Checks if is real.
      Parameters:
      dataType - the data type
      Returns:
      true, if is real
    • isFloat

      public static boolean isFloat(String dataType)
      Checks if is float.
      Parameters:
      dataType - the data type
      Returns:
      true, if is real
    • isBigint

      public static boolean isBigint(String dataType)
      Checks if is bigint.
      Parameters:
      dataType - the data type
      Returns:
      true, if is bigint
    • isSmallint

      public static boolean isSmallint(String dataType)
      Checks if is smallint.
      Parameters:
      dataType - the data type
      Returns:
      true, if is smallint
    • isInteger

      public static boolean isInteger(String dataType)
      Checks if is integer.
      Parameters:
      dataType - the data type
      Returns:
      true, if is integer
    • isTinyint

      public static boolean isTinyint(String dataType)
      Checks if is tinyint.
      Parameters:
      dataType - the data type
      Returns:
      true, if is tinyint
    • isTimestamp

      public static boolean isTimestamp(String dataType)
      Checks if is timestamp.
      Parameters:
      dataType - the data type
      Returns:
      true, if is timestamp
    • isDateTime

      public static boolean isDateTime(String dataType)
      Checks if is datetime.
      Parameters:
      dataType - the data type
      Returns:
      true, if is datetime
    • isTime

      public static boolean isTime(String dataType)
      Checks if is time.
      Parameters:
      dataType - the data type
      Returns:
      true, if is time
    • isDate

      public static boolean isDate(String dataType)
      Checks if is date.
      Parameters:
      dataType - the data type
      Returns:
      true, if is date
    • isChar

      public static boolean isChar(String dataType)
      Checks if is char.
      Parameters:
      dataType - the data type
      Returns:
      true, if is char
    • isVarchar

      public static boolean isVarchar(String dataType)
      Checks if is varchar.
      Parameters:
      dataType - the data type
      Returns:
      true, if is varchar
    • isText

      public static boolean isText(String dataType)
      Checks if is text.
      Parameters:
      dataType - the data type
      Returns:
      true, if is text
    • isCharacterVarying

      public static boolean isCharacterVarying(String dataType)
      Checks if is varchar.
      Parameters:
      dataType - the data type
      Returns:
      true, if is varchar
    • isNvarchar

      public static boolean isNvarchar(String dataType)
      Checks if is nvarchar.
      Parameters:
      dataType - the data type
      Returns:
      true, if is varchar
    • isDecimal

      public static boolean isDecimal(String dataType)
      Checks if is decimal.
      Parameters:
      dataType - the data type
      Returns:
      true, if is decimal
    • isBit

      public static boolean isBit(String dataType)
      Checks if is bit.
      Parameters:
      dataType - the data type
      Returns:
      true, if is bit
    • isArray

      public static boolean isArray(String dataType)
      Checks if is array.
      Parameters:
      dataType - the data type
      Returns:
      true, if is array