Class DataTypeUtils
java.lang.Object
org.eclipse.dirigible.database.sql.DataTypeUtils
The Class DataTypeUtils.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe Constant DECIMAL_DEFAULT_LENGTH.static final intThe default length. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 StringGets the database type name by java type.static ClassGets the java type by database type.static IntegergetSqlTypeByDataType(String type) Gets the sql type by data type.static StringgetUnifiedDatabaseType(String type) Gets the unified database type.static booleanChecks if is array.static booleanChecks if is bigint.static booleanChecks if is bit.static booleanChecks if is blob.static booleanChecks if is boolean.static booleanChecks if is char.static booleanisCharacterVarying(String dataType) Checks if is varchar.static booleanChecks if is database type supported.static booleanChecks if is date.static booleanisDateTime(String dataType) Checks if is datetime.static booleanChecks if is decimal.static booleanChecks if is double.static booleanChecks if is float.static booleanChecks if is integer.static booleanisNvarchar(String dataType) Checks if is nvarchar.static booleanChecks if is real.static booleanisSmallint(String dataType) Checks if is smallint.static booleanChecks if is text.static booleanChecks if is time.static booleanisTimestamp(String dataType) Checks if is timestamp.static booleanChecks if is tinyint.static booleanChecks if is varchar.
-
Field Details
-
VARCHAR_DEFAULT_LENGTH
public static final int VARCHAR_DEFAULT_LENGTHThe default length.- See Also:
-
DECIMAL_DEFAULT_LENGTH
public static final int DECIMAL_DEFAULT_LENGTHThe Constant DECIMAL_DEFAULT_LENGTH.- See Also:
-
-
Constructor Details
-
DataTypeUtils
public DataTypeUtils()
-
-
Method Details
-
getDatabaseType
Gets the database type.- Parameters:
type- the type- Returns:
- the database type
-
isDatabaseTypeSupported
Checks if is database type supported.- Parameters:
type- the type- Returns:
- true, if is database type supported
-
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
-
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
-
getUnifiedDatabaseType
Gets the unified database type.- Parameters:
type- the type- Returns:
- the unified database 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
-
isDateTime
Checks if is datetime.- Parameters:
dataType- the data type- Returns:
- true, if is datetime
-
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
-
isText
Checks if is text.- Parameters:
dataType- the data type- Returns:
- true, if is text
-
isCharacterVarying
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
-