Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcc882b2

Browse files
committed
更新部分依赖版本,更新MBG插件配置
1 parent23659fe commitcc882b2

File tree

7 files changed

+22
-118
lines changed

7 files changed

+22
-118
lines changed

‎pom.xml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,11 @@
1111

1212
<properties>
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14-
<!-- MyBatis Generator-->
15-
<!-- Java接口和实体类-->
16-
<targetJavaProject>${basedir}/src/main/java</targetJavaProject>
17-
<targetMapperPackage>com.isea533.mybatis.mapper</targetMapperPackage>
18-
<targetModelPackage>com.isea533.mybatis.model</targetModelPackage>
19-
<!-- XML生成路径-->
20-
<targetResourcesProject>${basedir}/src/main/resources</targetResourcesProject>
21-
<targetXMLPackage>mapper</targetXMLPackage>
2214
<!-- 编译jdk版本-->
2315
<jdk.version>1.6</jdk.version>
2416
<!-- 依赖版本-->
25-
<mybatis.version>3.3.1</mybatis.version>
26-
<mapper.version>3.4.5-SNAPSHOT</mapper.version>
17+
<mybatis.version>3.4.6</mybatis.version>
18+
<mapper.version>4.0.0</mapper.version>
2719
<pagehelper.version>5.0.0</pagehelper.version>
2820
<mysql.version>5.1.29</mysql.version>
2921
<spring.version>4.1.2.RELEASE</spring.version>
@@ -265,7 +257,7 @@
265257
<plugin>
266258
<groupId>org.mybatis.generator</groupId>
267259
<artifactId>mybatis-generator-maven-plugin</artifactId>
268-
<version>1.3.2</version>
260+
<version>1.3.6</version>
269261
<configuration>
270262
<configurationFile>${basedir}/src/main/resources/generator/generatorConfig.xml</configurationFile>
271263
<overwrite>true</overwrite>
Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,7 @@
1-
/*
2-
* The MIT License (MIT)
3-
*
4-
* Copyright (c) 2014 abel533@gmail.com
5-
*
6-
* Permission is hereby granted, free of charge, to any person obtaining a copy
7-
* of this software and associated documentation files (the "Software"), to deal
8-
* in the Software without restriction, including without limitation the rights
9-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10-
* copies of the Software, and to permit persons to whom the Software is
11-
* furnished to do so, subject to the following conditions:
12-
*
13-
* The above copyright notice and this permission notice shall be included in
14-
* all copies or substantial portions of the Software.
15-
*
16-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22-
* THE SOFTWARE.
23-
*/
24-
251
packagecom.isea533.mybatis.mapper;
262

273
importcom.isea533.mybatis.model.Country;
28-
importcom.isea533.mybatis.util.MyMapper;
29-
30-
publicinterfaceCountryMapperextendsMyMapper<Country> {
4+
importtk.mybatis.mapper.common.Mapper;
315

6+
publicinterfaceCountryMapperextendsMapper<Country> {
327
}

‎src/main/java/com/isea533/mybatis/model/Country.java

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,15 @@
1-
/*
2-
* The MIT License (MIT)
3-
*
4-
* Copyright (c) 2014 abel533@gmail.com
5-
*
6-
* Permission is hereby granted, free of charge, to any person obtaining a copy
7-
* of this software and associated documentation files (the "Software"), to deal
8-
* in the Software without restriction, including without limitation the rights
9-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10-
* copies of the Software, and to permit persons to whom the Software is
11-
* furnished to do so, subject to the following conditions:
12-
*
13-
* The above copyright notice and this permission notice shall be included in
14-
* all copies or substantial portions of the Software.
15-
*
16-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22-
* THE SOFTWARE.
23-
*/
24-
251
packagecom.isea533.mybatis.model;
262

27-
importjavax.persistence.Column;
28-
importjavax.persistence.GeneratedValue;
29-
importjavax.persistence.GenerationType;
30-
importjavax.persistence.Id;
3+
importjavax.persistence.*;
314

5+
@Table(name ="country")
326
publicclassCountry {
337
/**
348
* 主键
359
*/
3610
@Id
3711
@Column(name ="Id")
38-
@GeneratedValue(strategy =GenerationType.IDENTITY)
12+
@GeneratedValue(generator ="JDBC")
3913
privateIntegerid;
4014

4115
/**

‎src/main/resources/applicationContext.xml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,6 @@
9191

9292
<beanclass="tk.mybatis.spring.mapper.MapperScannerConfigurer">
9393
<propertyname="basePackage"value="com.isea533.mybatis.mapper"/>
94-
<!-- 3.2.2版本新特性,markerInterface可以起到mappers配置的作用,详细情况需要看Marker接口类-->
95-
<propertyname="markerInterface"value="com.isea533.mybatis.util.MyMapper"/>
96-
<!-- 通用Mapper通过属性注入进行配置,默认不配置时会注册Mapper<T>接口
97-
<property name="properties">
98-
<value>
99-
mappers=tk.mybatis.mapper.common.Mapper
100-
</value>
101-
</property>
102-
-->
10394
</bean>
10495

10596
<beanid="sqlSession"class="org.mybatis.spring.SqlSessionTemplate"scope="prototype">

‎src/main/resources/config.properties

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,4 @@ jdbc.password =
3232
jdbc.maxPoolSize=50
3333
jdbc.minPoolSize=10
3434
jdbc.maxStatements=100
35-
jdbc.testConnection=true
36-
37-
# \u901A\u7528Mapper\u914D\u7F6E
38-
mapper.plugin =tk.mybatis.mapper.generator.MapperPlugin
39-
mapper.Mapper =tk.mybatis.mapper.common.Mapper
35+
jdbc.testConnection=true

‎src/main/resources/generator/generatorConfig.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@
4646
password="${jdbc.password}">
4747
</jdbcConnection>
4848

49-
<javaModelGeneratortargetPackage="${targetModelPackage}"targetProject="${targetJavaProject}"/>
49+
<javaModelGeneratortargetPackage="com.isea533.mybatis.model"targetProject="src/main/java"/>
5050

51-
<sqlMapGeneratortargetPackage="${targetXMLPackage}"targetProject="${targetResourcesProject}"/>
51+
<sqlMapGeneratortargetPackage="mapper"targetProject="src/main/resources"/>
5252

53-
<javaClientGeneratortargetPackage="${targetMapperPackage}"targetProject="${targetJavaProject}"
53+
<javaClientGeneratortargetPackage="com.isea533.mybatis.mapper"targetProject="src/main/java"
5454
type="XMLMAPPER"/>
5555

56-
<tabletableName="%">
57-
<generatedKeycolumn="id"sqlStatement="Mysql"identity="true"/>
56+
<tabletableName="country">
57+
<generatedKeycolumn="id"sqlStatement="JDBC"/>
5858
</table>
5959
</context>
6060
</generatorConfiguration>

‎src/main/resources/mapper/CountryMapper.xml

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,13 @@
1-
<?xml version="1.0" encoding="UTF-8" ?>
2-
<!--
3-
~ The MIT License (MIT)
4-
~
5-
~ Copyright (c) 2014 abel533@gmail.com
6-
~
7-
~ Permission is hereby granted, free of charge, to any person obtaining a copy
8-
~ of this software and associated documentation files (the "Software"), to deal
9-
~ in the Software without restriction, including without limitation the rights
10-
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11-
~ copies of the Software, and to permit persons to whom the Software is
12-
~ furnished to do so, subject to the following conditions:
13-
~
14-
~ The above copyright notice and this permission notice shall be included in
15-
~ all copies or substantial portions of the Software.
16-
~
17-
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18-
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19-
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20-
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21-
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22-
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23-
~ THE SOFTWARE.
24-
-->
25-
26-
<!DOCTYPEmapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
27-
<mappernamespace="com.isea533.mybatis.mapper.CountryMapper" >
28-
<resultMapid="BaseResultMap"type="com.isea533.mybatis.model.Country" >
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPEmapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3+
<mappernamespace="com.isea533.mybatis.mapper.CountryMapper">
4+
<resultMapid="BaseResultMap"type="com.isea533.mybatis.model.Country">
295
<!--
30-
WARNING - @mbggenerated
6+
WARNING - @mbg.generated
317
-->
32-
<idcolumn="Id"property="id"jdbcType="INTEGER" />
33-
<resultcolumn="countryname"property="countryname"jdbcType="VARCHAR" />
34-
<resultcolumn="countrycode"property="countrycode"jdbcType="VARCHAR" />
8+
<idcolumn="Id"jdbcType="INTEGER"property="id" />
9+
<resultcolumn="countryname"jdbcType="VARCHAR"property="countryname" />
10+
<resultcolumn="countrycode"jdbcType="VARCHAR"property="countrycode" />
3511
</resultMap>
3612

3713
<selectid="selectByCountryQueryModel"resultMap="BaseResultMap">

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp