public class TypesInfo
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static TypesInfo |
DEFAULT |
static int |
LARGE |
static int |
OPTIMIZE |
static int |
SMALLEST |
| Constructor and Description |
|---|
TypesInfo(java.sql.Connection con) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAutoIncrement() |
int |
getDataType(java.lang.Class c)
get the
java.sql.Types value for a given class |
int |
getDataType(java.lang.String typeName,
int columnSize,
int decimaldigits)
get the closest datatype for a field given the typename, columSize and decimal digits
|
Database |
getDb() |
java.lang.Class |
getJavaType(int dataType,
int columnsize,
int decimaldigits)
gets a Class as a valid java type on the basis of JDBC column information
|
java.lang.String |
getJavaTypeName(int dataType,
int columnsize,
int decimaldigits)
gets a String representation of a valid java type on the basis of JDBC column information
|
java.lang.String |
getLimitRows(int count) |
java.lang.String |
getSQLType(int dataType,
int columnSize,
int decimaldigits) |
TypeModel |
getTypeModel(int dataType,
int columnSize,
int decimaldigits) |
java.util.Collection |
getTypeNames() |
java.util.List<TypeModel> |
getTypes() |
boolean |
isKeyWord(java.lang.String s) |
boolean |
isPrimitive(int dataType)
get the JavaType for a specific dataType as defined in java.sql.Types
|
void |
setDataModel(int dataModel) |
boolean |
supportsPseudoIdentifier() |
public static final TypesInfo DEFAULT
public static final int SMALLEST
public static final int OPTIMIZE
public static final int LARGE
public int getDataType(java.lang.Class c)
java.sql.Types value for a given classc - Class, the class for which the java.sql.Types value is requestedjava.sql.Typespublic java.lang.String getJavaTypeName(int dataType,
int columnsize,
int decimaldigits)
Normally the dataType is enough to make a good determination, except in the case of Numbers.
Types.OTHER is returned as a generic Object.
Note:Please be sure to understand that not all Types are defined and translated here if you miss one add it yourself or mail me.
dataType - int, A valid datatype from java.sql.Typescolumnsize - int, The length of the columndecimaldigits - int, The number of decimal digitspublic boolean isPrimitive(int dataType)
This method returns only one of two values PRIMITIVE or CLASS
dataType - int, the datatype as defined in java.sql.TypesNote:Please be sure to understand that the determination is not done for all Types if you miss one add it yourself or mail me.
public java.lang.Class getJavaType(int dataType,
int columnsize,
int decimaldigits)
Normally the dataType is enough to make a good determination, except in the case of Numbers.
Types.OTHER is returned as a generic Object.
Note:Please be sure to understand that not all Types are defined and translated here if you miss one add it yourself or mail me.
dataType - int, A valid datatype from java.sql.Typescolumnsize - int, The length of the columndecimaldigits - int, The number of decimal digitspublic java.lang.String getLimitRows(int count)
public boolean supportsPseudoIdentifier()
public java.lang.String getAutoIncrement()
public java.lang.String getSQLType(int dataType,
int columnSize,
int decimaldigits)
public TypeModel getTypeModel(int dataType, int columnSize, int decimaldigits)
public int getDataType(java.lang.String typeName,
int columnSize,
int decimaldigits)
typeName - String, the typename as given by the databasecolumnSize - int, column lengthdecimaldigits - int, the decimal digits for this typepublic java.util.Collection getTypeNames()
public java.util.List<TypeModel> getTypes()
public void setDataModel(int dataModel)
public boolean isKeyWord(java.lang.String s)
public Database getDb()