Skip to content

Commit 2cdca8c

Browse files
author
wanghaiming
committed
whm 修改默认生成的de方法
1 parent 0c6cefa commit 2cdca8c

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ enableUpdateByExampleSelective属性,其默认值为true;
1212
enableUpdateByPrimaryKey
1313
enableInsert默认改成了false ;
1414
(3)新增enableSelectAll
15-
enableSelectNotDele
16-
enableSelectNotDeleteByPrimaryKey属性,默认为false
15+
enableSelectNotDeleteAll
16+
enableSelectNotDeleteByPrimaryKey属性,默认为true
1717
对应的则在Mapper中添加了相应的方法。
1818
4、结合freemarker和XML生成了简单的Service和domain,对应的XML配置如下:
1919
<javaServiceGenerator targetPackage="com.btjf.business.authentication.custcertification.service"
@@ -26,7 +26,7 @@ enableSelectNotDeleteByPrimaryKey属性,默认为false;
2626
5、 注意:javaBoGenerator、javaServiceGenerator均为可选不进行配置,javaDomainGenerator和javaServiceGenerator成对出现(要么都配置,要么都不配置)
2727

2828
6、附上整个的generatorConfig.xml,所有的均以t_member表为例的。
29-
[html] view plain copy
29+
view plain copy
3030
<?xml version="1.0" encoding="UTF-8" ?>
3131

3232
<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >

java-generator-core/src/main/java/org/mybatis/generator/config/TableConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,16 @@ public TableConfiguration(Context context) {
143143
insertStatementEnabled = false;
144144
insertSelectiveStatementEnabled = true;
145145
selectByPrimaryKeyStatementEnabled = true;
146-
selectNotDeleteByPrimaryKeyStatementEnabled = false;
146+
selectNotDeleteByPrimaryKeyStatementEnabled = true;
147147
selectByExampleStatementEnabled = true;
148148
updateByPrimaryKeyStatementEnabled = false;
149149
deleteByPrimaryKeyStatementEnabled = true;
150150
deleteByExampleStatementEnabled = true;
151151
countByExampleStatementEnabled = true;
152152
updateByExampleStatementEnabled = false;
153153
updateByExampleSelectiveStatementEnabled = true;
154-
selectAllStatementEnabled = false;
155-
selectNotDeleteAllStatementEnabled = false;
154+
selectAllStatementEnabled = true;
155+
selectNotDeleteAllStatementEnabled = true;
156156
}
157157

158158
public boolean isSelectNotDeleteByPrimaryKeyStatementEnabled() {

java-generator-core/src/main/resources/generatorConfig.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<property name="enableSubPackages" value="true" />
4343
</javaClientGenerator>
4444

45-
<table tableName="t_LoginMemberLog" domainObjectName="MemberLoginLog" delimitIdentifiers="true" enableSelectAll="true" enableSelectNotDeleteAll="true" enableSelectNotDeleteByPrimaryKey="true">
45+
<table tableName="t_LoginMemberLog" domainObjectName="MemberLoginLog" delimitIdentifiers="true">
4646
<property name="useActualColumnNames" value="true"/>
4747
<generatedKey column="FID" sqlStatement="SELECT @@IDENTITY" identity="true" />
4848
<columnRenamingRule searchString="^(F|f)" replaceString=""/>

0 commit comments

Comments
 (0)