Package com.wisecoders.dbs.schema
Class DataTypeUtil
java.lang.Object
com.wisecoders.dbs.schema.DataTypeUtil
Utility class for data types.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int[]
getCompatibleJavaTypes
(int javaType) static int
getJavaTypeFromValue
(Object value) static Integer[]
static Integer
getTypeByName
(String dataTypeName) Get the java type from java.sql.Types for the given data type name.static String
getTypeName
(int javaType) Get the type name for a given java typestatic boolean
isBlob
(int javaType) static boolean
isBoolean
(int javaType) static boolean
isDate
(int javaType) static boolean
isInteger
(int javaType) static boolean
isLong
(int javaType) static boolean
isNumeric
(int javaType) static boolean
isText
(int javaType) static boolean
isTime
(int javaType) static boolean
isTimestamp
(int javaType) static boolean
isUUID
(int javaType)
-
Constructor Details
-
DataTypeUtil
public DataTypeUtil()
-
-
Method Details
-
isTimestamp
public static boolean isTimestamp(int javaType) -
isTime
public static boolean isTime(int javaType) -
isDate
public static boolean isDate(int javaType) - Parameters:
javaType
- represented as integer from java.sql.Types.- Returns:
- true if is representing a date
-
isBoolean
public static boolean isBoolean(int javaType) - Parameters:
javaType
- represented as integer from java.sql.Types.- Returns:
- true if it is representing a boolean
-
isBlob
public static boolean isBlob(int javaType) - Parameters:
javaType
- represented as integer from java.sql.Types.- Returns:
- true if it is representing a Blob
-
isNumeric
public static boolean isNumeric(int javaType) - Parameters:
javaType
- represented as integer from java.sql.Types.- Returns:
- true if it is representing a number ( integer, long, numeric, ... )
-
isUUID
public static boolean isUUID(int javaType) - Parameters:
javaType
- represented as integer from java.sql.Types.- Returns:
- true if it is representing a number ( integer, long, numeric, ... )
-
isInteger
public static boolean isInteger(int javaType) -
isText
public static boolean isText(int javaType) -
isLong
public static boolean isLong(int javaType) -
getTypeName
Get the type name for a given java type- Parameters:
javaType
- from java.sql.Types- Returns:
- the type name
-
getJavaTypesArray
- Returns:
- An array of the JavaTypes from java.sql.Types
-
getTypeByName
Get the java type from java.sql.Types for the given data type name.- Parameters:
dataTypeName
- as text- Returns:
- javaType from java.sql.Types
-
getCompatibleJavaTypes
public static int[] getCompatibleJavaTypes(int javaType) -
getJavaTypeFromValue
-