继续添加类
//------------- 数据类型转换器-----------
package com.han.sorm.core;
/**
*masql数据类型和java数据类型的转换
*/
public class MySqlTypeConvertor implements TypeConvertor{
public String databaseType2JavaType(String columnType) {
//varchar转换String类型 ;转换器
if("varchar".equalsIgnoreCase(columnType)
||"char".equalsIgnoreCase(columnType)){
return "String";
}else if("int".equalsIgnoreCase(columnType)
||"tinyint".equalsIgnoreCase(columnType)
||"smallint".equalsIgnoreCase(columnType)
||"integer".equalsIgnoreCase(columnType)){
return "Integer";
}else if("bigint".equalsIgnoreCase(columnType)){
return "Long";
}else if("double".equalsIgnoreCase(columnType)
||"float".equalsIgnoreCase(columnType)){
return "Double";
}else if("blob".equalsIgnoreCase(columnType)){
return "java.sql.Blob";
}else if("date".equalsIgnoreCase(columnType)){
return "java.sql.Date";
}else if("time".equalsIgnoreCase(columnType)){
return "java.sql.Time";
}else if("timestamp".equalsIgnoreCase(columnType)){
return "java.sql.Timestamp";
}
//如果有其他类型可以在这里添加
return null;
}
public String javaType2DatabaseType(String javaDataType) {
return null;
}
}