-
Notifications
You must be signed in to change notification settings - Fork 12
Data Type
Yong Zhu edited this page Jan 20, 2018
·
1 revision
Different databases have different data types, detail can see DatabaseDialects.xls file. jDialects offer some methods to do the translation:
In TypeUtils:
//Translate java.sql.Types.xxx to Dialect.Type
public static Type javaSqlTypeToDialectType(int javaSqlType)
//Translate column definition String to Dialect.Type
public static Type toType(String columnDef)
//Translate Java's primitive class like String to Dialect.Type
public static Type toType(Class<?> clazz)
//Check if a Java class can transfer to Dialect.Type
public static boolean canMapToSqlType(Class<?> clazz)
In Dialect:
//Translate Dialect.Type to DDL definition String
public String translateToDDLType(Type type, Integer... lengths)