Package org.nutz.dao.entity.annotation

Examples of org.nutz.dao.entity.annotation.Table


  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);
View Full Code Here

TOP

Related Classes of org.nutz.dao.entity.annotation.Table

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.