private static TableMapper getTableMapper(Class<?> entityClass) {
// 表名
TableMapper tableMapper = new TableMapper();
String tableName = null;
if (entityClass.isAnnotationPresent(Table.class)) {
Table table = entityClass.getAnnotation(Table.class);
if (!table.name().equals("")) {
tableName = table.name();
} else {
tableName = camelhumpToUnderline(entityClass.getSimpleName());
}
}
if (tableName == null || tableName.equals("")) {
throw new RuntimeException("实体" + entityClass.getName() + "不存在'Table'注解");
}
tableMapper.setName(tableName);
return tableMapper;
}
EntityHelper.java 文件源码
java
阅读 37
收藏 0
点赞 0
评论 0
项目:jeesuite-libs
作者:
评论列表
文章目录