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 intgetJavaTypeFromValue(Object value) static Integer[]static IntegergetTypeByName(String dataTypeName) Get the java type from java.sql.Types for the given data type name.static StringgetTypeName(int javaType) Get the type name for a given java typestatic booleanisBlob(int javaType) static booleanisBoolean(int javaType) static booleanisDate(int javaType) static booleanisInteger(int javaType) static booleanisLong(int javaType) static booleanisNumeric(int javaType) static booleanisText(int javaType) static booleanisTime(int javaType) static booleanisTimestamp(int javaType) static booleanisUUID(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
-