我的java 的实用代码

   /**
    * 得到实体对应的表名.Annotation方式
    * @param c
    * @return
    */
   public static String getTableName(Class c) {
	  Table annotation = (Table) c.getAnnotation(Table.class);
	  String tableName="";
	  if(annotation==null)
	  {
		  tableName=c.getSimpleName();
	  }else
	  {
		  tableName=annotation.name();
	  }
	  return tableName;
   }

  

原文地址:https://www.cnblogs.com/passer1991/p/3086342.html