0
点赞
收藏
分享

微信扫一扫

我的java 的实用代码

dsysama 2023-04-12 阅读 72


/**
    * 得到实体对应的表名.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;
   }


  

举报

相关推荐

0 条评论