private static final Log log = Logs.getLog(ConventionEntityMaker.class);
public Entity<?> make(DatabaseMeta db, Connection conn, Class<?> type) {
//先判断是否有注解
String tableName=null;
Table tableAnnotation=type.getAnnotation(Table.class);
if(tableAnnotation==null){//如果有table标签
tableName=this.getOrmRule().class2TableName(type.getSimpleName());
}else{
tableName=tableAnnotation.value();
}
String viewName=null;
View viewAnnotation=type.getAnnotation(View.class);
if(viewAnnotation==null&&tableAnnotation==null){//如果有view标签
viewName=this.getOrmRule().class2TableName(type.getSimpleName());
}else if(tableAnnotation!=null){
viewName=tableAnnotation.value();
}else{
viewName=viewAnnotation.value();
}
// 得到表结构
MyTable table=CollectData.getTableByTableName(tableName, conn,false);