Class DataTypeUtils
java.lang.Object
org.eclipse.dirigible.database.sql.DataTypeUtils
public class DataTypeUtils extends Object
The Class DataTypeUtils.
-
Field Summary
Fields Modifier and Type Field Description static intDECIMAL_DEFAULT_LENGTHThe Constant DECIMAL_DEFAULT_LENGTH.static intVARCHAR_DEFAULT_LENGTHThe default length. -
Constructor Summary
Constructors Constructor Description DataTypeUtils() -
Method Summary
Modifier and Type Method Description static DataTypegetDatabaseType(Integer type)Gets the database type.static IntegergetDatabaseTypeByJavaType(Class clazz)Gets the database type by java type.static StringgetDatabaseTypeName(Integer type)Gets the database type name.static StringgetDatabaseTypeNameByJavaType(Class clazz)Gets the database type name by java type.static ClassgetJavaTypeByDatabaseType(Integer type)Gets the java type by database type.static IntegergetSqlTypeByDataType(String type)Gets the sql type by data type.static booleanisArray(String dataType)Checks if is array.static booleanisBigint(String dataType)Checks if is bigint.static booleanisBit(String dataType)Checks if is bit.static booleanisBlob(String dataType)Checks if is blob.static booleanisBoolean(String dataType)Checks if is boolean.static booleanisChar(String dataType)Checks if is char.static booleanisDatabaseTypeSupported(Integer type)Checks if is database type supported.static booleanisDate(String dataType)Checks if is date.static booleanisDecimal(String dataType)Checks if is decimal.static booleanisDouble(String dataType)Checks if is double.static booleanisFloat(String dataType)Checks if is float.static booleanisInteger(String dataType)Checks if is integer.static booleanisNvarchar(String dataType)Checks if is nvarchar.static booleanisReal(String dataType)Checks if is real.static booleanisSmallint(String dataType)Checks if is smallint.static booleanisTime(String dataType)Checks if is time.static booleanisTimestamp(String dataType)Checks if is timestamp.static booleanisTinyint(String dataType)Checks if is tinyint.static booleanisVarchar(String dataType)Checks if is varchar.
-
Field Details
-
VARCHAR_DEFAULT_LENGTH
public static final int VARCHAR_DEFAULT_LENGTHThe default length.- See Also:
- Constant Field Values
-
DECIMAL_DEFAULT_LENGTH
public static final int DECIMAL_DEFAULT_LENGTHThe Constant DECIMAL_DEFAULT_LENGTH.- See Also:
- Constant Field Values
-
-
Constructor Details
-
DataTypeUtils
public DataTypeUtils()
-
-
Method Details
-
isDatabaseTypeSupported
Checks if is database type supported.- Parameters:
type- the type- Returns:
- true, if is database type supported
-
getDatabaseType
Gets the database type.- Parameters:
type- the type- Returns:
- the database type
-
getDatabaseTypeName
Gets the database type name.- Parameters:
type- the type- Returns:
- the database type name
-
getDatabaseTypeByJavaType
Gets the database type by java type.- Parameters:
clazz- the clazz- Returns:
- the database type by java type
-
getJavaTypeByDatabaseType
Gets the java type by database type.- Parameters:
type- the type- Returns:
- the java type by database type
-
getSqlTypeByDataType
Gets the sql type by data type.- Parameters:
type- the type- Returns:
- the sql type by data type
-
getDatabaseTypeNameByJavaType
Gets the database type name by java type.- Parameters:
clazz- the clazz- Returns:
- the database type name by java type
-
isBlob
Checks if is blob.- Parameters:
dataType- the data type- Returns:
- true, if is blob
-
isBoolean
Checks if is boolean.- Parameters:
dataType- the data type- Returns:
- true, if is boolean
-
isDouble
Checks if is double.- Parameters:
dataType- the data type- Returns:
- true, if is double
-
isReal
Checks if is real.- Parameters:
dataType- the data type- Returns:
- true, if is real
-
isFloat
Checks if is float.- Parameters:
dataType- the data type- Returns:
- true, if is real
-
isBigint
Checks if is bigint.- Parameters:
dataType- the data type- Returns:
- true, if is bigint
-
isSmallint
Checks if is smallint.- Parameters:
dataType- the data type- Returns:
- true, if is smallint
-
isInteger
Checks if is integer.- Parameters:
dataType- the data type- Returns:
- true, if is integer
-
isTinyint
Checks if is tinyint.- Parameters:
dataType- the data type- Returns:
- true, if is tinyint
-
isTimestamp
Checks if is timestamp.- Parameters:
dataType- the data type- Returns:
- true, if is timestamp
-
isTime
Checks if is time.- Parameters:
dataType- the data type- Returns:
- true, if is time
-
isDate
Checks if is date.- Parameters:
dataType- the data type- Returns:
- true, if is date
-
isChar
Checks if is char.- Parameters:
dataType- the data type- Returns:
- true, if is char
-
isVarchar
Checks if is varchar.- Parameters:
dataType- the data type- Returns:
- true, if is varchar
-
isNvarchar
Checks if is nvarchar.- Parameters:
dataType- the data type- Returns:
- true, if is varchar
-
isDecimal
Checks if is decimal.- Parameters:
dataType- the data type- Returns:
- true, if is decimal
-
isBit
Checks if is bit.- Parameters:
dataType- the data type- Returns:
- true, if is bit
-
isArray
Checks if is array.- Parameters:
dataType- the data type- Returns:
- true, if is array
-