From d304a0a0a26a45a2fb44383196556d8a9f76ca5e Mon Sep 17 00:00:00 2001 From: "chenbin.sun@baozun.com" Date: Fri, 29 May 2020 11:17:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DCUDR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 12 ++++--- mybatis-enhance-actable/.classpath | 26 -------------- mybatis-enhance-actable/.project | 36 ------------------- .../.settings/org.eclipse.jdt.core.prefs | 8 ----- .../.settings/org.eclipse.m2e.core.prefs | 4 --- .../org.eclipse.wst.common.component | 5 --- ....eclipse.wst.common.project.facet.core.xml | 5 --- .../org.eclipse.wst.validation.prefs | 2 -- mybatis-enhance-actable/README.md | 12 ++++--- .../common/BaseMysqlCRUDManagerImpl.java | 12 +++---- 10 files changed, 20 insertions(+), 102 deletions(-) delete mode 100644 mybatis-enhance-actable/.classpath delete mode 100644 mybatis-enhance-actable/.project delete mode 100644 mybatis-enhance-actable/.settings/org.eclipse.jdt.core.prefs delete mode 100644 mybatis-enhance-actable/.settings/org.eclipse.m2e.core.prefs delete mode 100644 mybatis-enhance-actable/.settings/org.eclipse.wst.common.component delete mode 100644 mybatis-enhance-actable/.settings/org.eclipse.wst.common.project.facet.core.xml delete mode 100644 mybatis-enhance-actable/.settings/org.eclipse.wst.validation.prefs diff --git a/README.md b/README.md index b4189ee..0a56d2b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# mybatis-enhance-actable-1.0.9.RELEASE +# mybatis-enhance-actable-1.0.9.1.RELEASE A.C.Table是对Mybatis做的增强功能,为了能够使习惯了hibernate框架的开发者能够快速的入手Mybatis,我给他取名叫做 “A.C.Table” 本意是自动建表的意思,A.C.Table是一个基于Spring和Mybatis的Maven项目,增强了Mybatis的功能,过配置model注解的方式来创建表,修改表结构,并且实现了共通的CUDR功能提升开发效率,目前仅支持Mysql,后续会扩展针对其他数据库的支持。 @@ -51,15 +51,17 @@ A.C.Table是采用了Spring、Mybatis技术的Maven结构,详细介绍如下 本次迭代至1.0.9.RELEASE,极大的简化了注解的使用复杂度,在保留原有复杂的自定义配置能力的同时,增加了更多的默认适配能力 也就是对于@Column标签如果对字段命名等没有任何要求的情况下,直接使用标签即可,无需配置类型等参数,会默认根据上面支持的类型去进行匹配转换 28. 迭代issues/I1ILS6:@IsKey/@IsAutoIncrement/@IsNotNull用来代替 @Column中的isKey/isAutoIncrement/isNull三个属性,当然旧的配置方式仍然是支持的 (版本1.0.9.RELEASE) +29. 紧急修复1.0.9.RELEASE版本CUDR的bug,请不要使用1.0.9.RELEASE版本(版本1.0.9.1.RELEASE) + **基本使用规范** -1. 需要依赖mybatis-enhance-actable-1.0.9.RELEASE.jar +1. 需要依赖mybatis-enhance-actable-1.0.9.1.RELEASE.jar ``` com.gitee.sunchenbin.mybatis.actable mybatis-enhance-actable - 1.0.9.RELEASE + 1.0.9.1.RELEASE ``` @@ -110,7 +112,7 @@ A.C.Table是采用了Spring、Mybatis技术的Maven结构,详细介绍如下 com.gitee.sunchenbin.mybatis.actable mybatis-enhance-actable - 1.0.9.RELEASE + 1.0.9.1.RELEASE ``` @@ -137,7 +139,7 @@ A.C.Table是采用了Spring、Mybatis技术的Maven结构,详细介绍如下 com.gitee.sunchenbin.mybatis.actable mybatis-enhance-actable - 1.0.9.RELEASE + 1.0.9.1.RELEASE ``` diff --git a/mybatis-enhance-actable/.classpath b/mybatis-enhance-actable/.classpath deleted file mode 100644 index 6d4d1ba..0000000 --- a/mybatis-enhance-actable/.classpath +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mybatis-enhance-actable/.project b/mybatis-enhance-actable/.project deleted file mode 100644 index b38abaa..0000000 --- a/mybatis-enhance-actable/.project +++ /dev/null @@ -1,36 +0,0 @@ - - - mybatis-enhance-actable - - - - - - org.eclipse.wst.common.project.facet.core.builder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.wst.validation.validationbuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.jem.workbench.JavaEMFNature - org.eclipse.wst.common.modulecore.ModuleCoreNature - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - org.eclipse.wst.common.project.facet.core.nature - - diff --git a/mybatis-enhance-actable/.settings/org.eclipse.jdt.core.prefs b/mybatis-enhance-actable/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 69c31cd..0000000 --- a/mybatis-enhance-actable/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,8 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/mybatis-enhance-actable/.settings/org.eclipse.m2e.core.prefs b/mybatis-enhance-actable/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f..0000000 --- a/mybatis-enhance-actable/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 diff --git a/mybatis-enhance-actable/.settings/org.eclipse.wst.common.component b/mybatis-enhance-actable/.settings/org.eclipse.wst.common.component deleted file mode 100644 index e6a577f..0000000 --- a/mybatis-enhance-actable/.settings/org.eclipse.wst.common.component +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/mybatis-enhance-actable/.settings/org.eclipse.wst.common.project.facet.core.xml b/mybatis-enhance-actable/.settings/org.eclipse.wst.common.project.facet.core.xml deleted file mode 100644 index a50949e..0000000 --- a/mybatis-enhance-actable/.settings/org.eclipse.wst.common.project.facet.core.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/mybatis-enhance-actable/.settings/org.eclipse.wst.validation.prefs b/mybatis-enhance-actable/.settings/org.eclipse.wst.validation.prefs deleted file mode 100644 index 04cad8c..0000000 --- a/mybatis-enhance-actable/.settings/org.eclipse.wst.validation.prefs +++ /dev/null @@ -1,2 +0,0 @@ -disabled=06target -eclipse.preferences.version=1 diff --git a/mybatis-enhance-actable/README.md b/mybatis-enhance-actable/README.md index 08ed193..2ab7554 100644 --- a/mybatis-enhance-actable/README.md +++ b/mybatis-enhance-actable/README.md @@ -1,4 +1,4 @@ -# mybatis-enhance-actable-1.0.9.RELEASE +# mybatis-enhance-actable-1.0.9.1.RELEASE A.C.Table是对Mybatis做的增强功能,为了能够使习惯了hibernate框架的开发者能够快速的入手Mybatis,我给他取名叫做 “A.C.Table” 本意是自动建表的意思,A.C.Table是一个基于Spring和Mybatis的Maven项目,增强了Mybatis的功能,过配置model注解的方式来创建表,修改表结构,并且实现了共通的CUDR功能提升开发效率,目前仅支持Mysql,后续会扩展针对其他数据库的支持。 @@ -51,15 +51,17 @@ A.C.Table是采用了Spring、Mybatis技术的Maven结构,详细介绍如下 本次迭代至1.0.9.RELEASE,极大的简化了注解的使用复杂度,在保留原有复杂的自定义配置能力的同时,增加了更多的默认适配能力 也就是对于@Column标签如果对字段命名等没有任何要求的情况下,直接使用标签即可,无需配置类型等参数,会默认根据上面支持的类型去进行匹配转换 28. 迭代issues/I1ILS6:@IsKey/@IsAutoIncrement/@IsNotNull用来代替 @Column中的isKey/isAutoIncrement/isNull三个属性,当然旧的配置方式仍然是支持的 (版本1.0.9.RELEASE) +29. 紧急修复1.0.9.RELEASE版本CUDR的bug,请不要使用1.0.9.RELEASE版本(版本1.0.9.1.RELEASE) + **基本使用规范** -1. 需要依赖mybatis-enhance-actable-1.0.9.RELEASE.jar +1. 需要依赖mybatis-enhance-actable-1.0.9.1.RELEASE.jar ``` com.gitee.sunchenbin.mybatis.actable mybatis-enhance-actable - 1.0.9.RELEASE + 1.0.9.1.RELEASE ``` @@ -110,7 +112,7 @@ A.C.Table是采用了Spring、Mybatis技术的Maven结构,详细介绍如下 com.gitee.sunchenbin.mybatis.actable mybatis-enhance-actable - 1.0.9.RELEASE + 1.0.9.1.RELEASE ``` @@ -137,7 +139,7 @@ A.C.Table是采用了Spring、Mybatis技术的Maven结构,详细介绍如下 com.gitee.sunchenbin.mybatis.actable mybatis-enhance-actable - 1.0.9.RELEASE + 1.0.9.1.RELEASE ``` diff --git a/mybatis-enhance-actable/src/main/java/com/gitee/sunchenbin/mybatis/actable/manager/common/BaseMysqlCRUDManagerImpl.java b/mybatis-enhance-actable/src/main/java/com/gitee/sunchenbin/mybatis/actable/manager/common/BaseMysqlCRUDManagerImpl.java index 4d2ed3b..c22f740 100644 --- a/mybatis-enhance-actable/src/main/java/com/gitee/sunchenbin/mybatis/actable/manager/common/BaseMysqlCRUDManagerImpl.java +++ b/mybatis-enhance-actable/src/main/java/com/gitee/sunchenbin/mybatis/actable/manager/common/BaseMysqlCRUDManagerImpl.java @@ -68,7 +68,7 @@ public class BaseMysqlCRUDManagerImpl implements BaseMysqlCRUDManager{ continue; } - dataMap.put(column.name(), field.get(obj)); + dataMap.put(ColumnUtils.getColumnName(field,column), field.get(obj)); }catch (IllegalArgumentException e){ e.printStackTrace(); }catch (IllegalAccessException e){ @@ -121,7 +121,7 @@ public class BaseMysqlCRUDManagerImpl implements BaseMysqlCRUDManager{ continue; } try{ - dataMap.put(column.name(), field.get(obj)); + dataMap.put(ColumnUtils.getColumnName(field,column), field.get(obj)); }catch (IllegalArgumentException e){ e.printStackTrace(); }catch (IllegalAccessException e){ @@ -177,9 +177,9 @@ public class BaseMysqlCRUDManagerImpl implements BaseMysqlCRUDManager{ continue; } if (field.get(obj) instanceof String && field.get(obj) != null && "".equals(field.get(obj))) { - dataMap.put(column.name(), null); + dataMap.put(ColumnUtils.getColumnName(field,column), null); }else { - dataMap.put(column.name(), field.get(obj)); + dataMap.put(ColumnUtils.getColumnName(field,column), field.get(obj)); } }catch (IllegalArgumentException e){ e.printStackTrace(); @@ -210,7 +210,7 @@ public class BaseMysqlCRUDManagerImpl implements BaseMysqlCRUDManager{ log.debug("该field没有配置注解不是表中在字段!"); continue; } - String name = column.name(); + String name = ColumnUtils.getColumnName(field,column); field.set(newInstance, map.get(name)); } list.add(newInstance); @@ -329,7 +329,7 @@ public class BaseMysqlCRUDManagerImpl implements BaseMysqlCRUDManager{ keyFieldMap.put(field.getName(), field.get(obj)); updateId = (Integer) field.get(obj); } - dataMap.put(column.name(), field.get(obj)); + dataMap.put(ColumnUtils.getColumnName(field,column), field.get(obj)); }catch (IllegalArgumentException e){ e.printStackTrace(); }catch (IllegalAccessException e){ -- Gitee