org.tinygroup.dbrouter.value
public class DataType extends Object
| Modifier and Type | Field and 描述 |
|---|---|
static int |
TYPE_RESULT_SET
This constant is used to represent the type of a ResultSet.
|
| Constructor and 描述 |
|---|
DataType() |
| Modifier and Type | Method and 描述 |
|---|---|
static int |
convertSQLTypeToValueType(int sqlType)
Convert a SQL type to a value type.
|
static int |
getAddProofType(int type)
Get the data type that will not overflow when calling 'add' 2 billion times.
|
static DataType |
getDataType(int type)
Get the data type object for the given value type.
|
int |
getDefaultDisplaySize() |
static Object |
getDefaultForPrimitiveType(Class<?> clazz)
Get the default value in the form of a Java object for the given Java class.
|
long |
getDefaultPrecision() |
int |
getDefaultScale() |
String |
getJdbc() |
long |
getMaxPrecision() |
int |
getMaxScale() |
int |
getMinScale() |
String |
getName() |
static Class<?> |
getNonPrimitiveClass(Class<?> clazz)
Convert primitive class names to java.lang.* class names.
|
String |
getParams() |
String |
getPrefix() |
int |
getSqlType() |
int |
getSqlTypePos() |
String |
getSuffix() |
int |
getType() |
static DataType |
getTypeByName(String s)
Get a data type object from a type name.
|
static String |
getTypeClassName(int type)
Get the name of the Java class for the given value type.
|
static int |
getTypeFromClass(Class<?> x)
Get the value type for the given Java class.
|
static List<DataType> |
getTypes()
Get the list of data types.
|
boolean |
isAutoIncrement() |
boolean |
isCaseSensitive() |
boolean |
isDecimal() |
boolean |
isHidden() |
static boolean |
isLargeObject(int type)
Check if the given value type is a large object (BLOB or CLOB).
|
static boolean |
isStringType(int type)
Check if the given value type is a String (VARCHAR,...).
|
boolean |
isSupportsPrecision() |
boolean |
isSupportsScale() |
static boolean |
supportsAdd(int type)
Check if the given value type supports the add operation.
|
public static final int TYPE_RESULT_SET
public static String getTypeClassName(int type)
type - the value typepublic static int convertSQLTypeToValueType(int sqlType)
sqlType - the SQL typepublic static int getTypeFromClass(Class<?> x)
x - the Java classpublic static Class<?> getNonPrimitiveClass(Class<?> clazz)
clazz - the class (for example: int)public static boolean isLargeObject(int type)
type - the value typepublic static boolean isStringType(int type)
type - the value typepublic static boolean supportsAdd(int type)
type - the value typepublic static int getAddProofType(int type)
type - the value typepublic static Object getDefaultForPrimitiveType(Class<?> clazz)
clazz - the Java classpublic static DataType getDataType(int type)
type - the value typepublic static DataType getTypeByName(String s)
s - the type namepublic int getType()
public String getName()
public int getSqlType()
public String getJdbc()
public int getSqlTypePos()
public long getMaxPrecision()
public int getMinScale()
public int getMaxScale()
public boolean isDecimal()
public String getPrefix()
public String getSuffix()
public String getParams()
public boolean isAutoIncrement()
public boolean isCaseSensitive()
public boolean isSupportsPrecision()
public boolean isSupportsScale()
public long getDefaultPrecision()
public int getDefaultScale()
public int getDefaultDisplaySize()
public boolean isHidden()
Copyright © 2006–2015 TinyGroup. All rights reserved.