Skip to content

Commit 138614c

Browse files
committed
升级插件版本
1 parent 24bfcef commit 138614c

File tree

4 files changed

+72
-94
lines changed

4 files changed

+72
-94
lines changed

README.md

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,31 @@
11
#SSM集成的基础项目,项目使用Maven管理
22

3-
#MyBatis3.2.8
3+
#MyBatis3.3.0
44

55
#Spring3.2.12
66

7-
项目使用Spring3.2.12+SpringMVC3.2.12+Mybatis3.2.8
7+
项目使用Spring3.2.12 + SpringMVC3.2.12 + Mybatis3.3.0
88

99
项目集成了Mybatis分页插件和通用Mapper插件
1010

1111
项目使用的hsqldb内存数据库,根据需要可以切换为其他支持的数据库
1212

13-
#Spring4分支
13+
##MyBatis工具
1414

15-
本项目还有一个使用Spring4的分支:[Spring4](https://github.com/abel533/Mybatis-Spring/tree/spring4)
15+
###http://www.mybatis.tk
1616

1717
##推荐使用Mybatis通用Mapper
1818

19-
项目地址:https://github.com/abel533/Mapper
19+
###https://github.com/abel533/Mapper
2020

2121
##推荐使用Mybatis分页插件
2222

23-
Mybatis分页插件oschub的项目地址:http://git.oschina.net/free/Mybatis_PageHelper
24-
25-
Mybatis分页插件github的项目地址:https://github.com/pagehelper/Mybatis-PageHelper
26-
27-
分页插件文档地址:http://git.oschina.net/free/Mybatis_PageHelper/wikis/home
28-
29-
30-
##其他相关信息
31-
32-
Mybatis项目:https://github.com/mybatis/mybatis-3
33-
34-
Mybatis文档:http://mybatis.github.io/mybatis-3/zh/index.html
35-
36-
Mybatis专栏:
37-
Mybatis示例:http://blog.csdn.net/column/details/mybatis-sample.html
38-
Mybatis问题集:http://blog.csdn.net/column/details/mybatisqa.html
23+
###https://github.com/pagehelper/Mybatis-PageHelper
3924

4025
##作者信息
4126

42-
作者博客:
43-
http://my.oschina.net/flags/blog
44-
http://blog.csdn.net/isea533
45-
46-
作者QQ: 120807756
27+
- 作者博客:http://blog.csdn.net/isea533
4728

48-
作者邮箱: abel533@gmail.com
29+
- 作者邮箱: abel533@gmail.com
4930

50-
Mybatis工具群: 211286137 (Mybatis相关工具插件等等)
31+
- Mybatis工具群: 211286137 (Mybatis相关工具插件等等)

pom.xml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
22
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.isea533</groupId>
@@ -13,8 +13,10 @@
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1414
<targetProject>${basedir}/src/main/java</targetProject>
1515
<!-- 依赖版本 -->
16-
<mapper.version>3.1.0</mapper.version>
17-
<pagehelper.version>3.7.4</pagehelper.version>
16+
<mybatis.version>3.3.0</mybatis.version>
17+
<mapper.version>3.3.0</mapper.version>
18+
<pagehelper.version>4.0.3</pagehelper.version>
19+
<spring.version>3.2.12.RELEASE</spring.version>
1820
</properties>
1921

2022
<dependencies>
@@ -155,7 +157,7 @@
155157
<dependency>
156158
<groupId>org.mybatis</groupId>
157159
<artifactId>mybatis</artifactId>
158-
<version>3.2.8</version>
160+
<version>${mybatis.version}</version>
159161
</dependency>
160162
<dependency>
161163
<groupId>org.mybatis</groupId>
@@ -193,7 +195,7 @@
193195
<dependency>
194196
<groupId>org.springframework</groupId>
195197
<artifactId>spring-framework-bom</artifactId>
196-
<version>3.2.12.RELEASE</version>
198+
<version>${spring.version}</version>
197199
<type>pom</type>
198200
<scope>import</scope>
199201
</dependency>
Lines changed: 56 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<beans xmlns="http://www.springframework.org/schema/beans"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
43
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
54
xmlns:tx="http://www.springframework.org/schema/tx"
65
xmlns:aop="http://www.springframework.org/schema/aop"
76
xmlns:context="http://www.springframework.org/schema/context"
7+
xmlns="http://www.springframework.org/schema/beans"
88
xsi:schemaLocation="http://www.springframework.org/schema/beans
99
http://www.springframework.org/schema/beans/spring-beans.xsd
1010
http://www.springframework.org/schema/jdbc
@@ -16,70 +16,68 @@
1616
http://www.springframework.org/schema/context
1717
http://www.springframework.org/schema/context/spring-context.xsd">
1818

19-
<context:component-scan base-package="com.isea533.mybatis.service"/>
19+
<context:component-scan base-package="com.isea533.mybatis.service"/>
2020

21-
<!--hsqldb测试数据库-->
22-
<jdbc:embedded-database id="dataSource">
23-
<jdbc:script location="classpath:hsqldb.sql"/>
24-
</jdbc:embedded-database>
21+
<!--hsqldb测试数据库-->
22+
<jdbc:embedded-database id="dataSource">
23+
<jdbc:script location="classpath:hsqldb.sql"/>
24+
</jdbc:embedded-database>
2525

26-
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
27-
<property name="dataSource" ref="dataSource"/>
28-
<property name="mapperLocations">
29-
<array>
30-
<value>classpath:mapper/*.xml</value>
31-
<value>classpath:com/isea533/mybatis/mapper/*.xml</value>
32-
</array>
33-
</property>
34-
<property name="typeAliasesPackage" value="com.isea533.mybatis.model"/>
35-
<property name="plugins">
36-
<array>
37-
<bean class="com.github.pagehelper.PageHelper">
38-
<property name="properties">
39-
<value>
40-
dialect=hsqldb
41-
reasonable=true
42-
</value>
43-
</property>
44-
</bean>
45-
<bean class="tk.mybatis.mapper.mapperhelper.MapperInterceptor">
46-
<property name="properties">
26+
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
27+
<property name="dataSource" ref="dataSource"/>
28+
<property name="mapperLocations">
29+
<array>
30+
<value>classpath:mapper/*.xml</value>
31+
<value>classpath:com/isea533/mybatis/mapper/*.xml</value>
32+
</array>
33+
</property>
34+
<property name="typeAliasesPackage" value="com.isea533.mybatis.model"/>
35+
<property name="plugins">
36+
<array>
37+
<bean class="com.github.pagehelper.PageHelper">
38+
<property name="properties">
39+
<value>
40+
dialect=hsqldb
41+
reasonable=true
42+
</value>
43+
</property>
44+
</bean>
45+
</array>
46+
</property>
47+
</bean>
48+
49+
<bean class="tk.mybatis.spring.mapper.MapperScannerConfigurer">
50+
<property name="basePackage" value="com.isea533.mybatis.mapper"/>
51+
<!-- 通用Mapper通过属性注入进行配置,默认不配置时会注册Mapper<T>接口
52+
<property name="properties">
4753
<value>
4854
mappers=tk.mybatis.mapper.common.Mapper
49-
IDENTITY=MYSQL
50-
notEmpty=true
5155
</value>
52-
</property>
53-
</bean>
54-
</array>
55-
</property>
56-
</bean>
57-
58-
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
59-
<property name="basePackage" value="com.isea533.mybatis.mapper"/>
60-
</bean>
56+
</property>
57+
-->
58+
</bean>
6159

62-
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate" scope="prototype">
63-
<constructor-arg index="0" ref="sqlSessionFactory"/>
64-
</bean>
60+
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate" scope="prototype">
61+
<constructor-arg index="0" ref="sqlSessionFactory"/>
62+
</bean>
6563

66-
<aop:aspectj-autoproxy/>
64+
<aop:aspectj-autoproxy/>
6765

68-
<aop:config>
69-
<aop:pointcut id="appService" expression="execution(* com.isea533.mybatis.service.*.*Service*(..))"/>
70-
<aop:advisor advice-ref="txAdvice" pointcut-ref="appService"/>
71-
</aop:config>
66+
<aop:config>
67+
<aop:pointcut id="appService" expression="execution(* com.isea533.mybatis.service.*.*Service*(..))"/>
68+
<aop:advisor advice-ref="txAdvice" pointcut-ref="appService"/>
69+
</aop:config>
7270

73-
<tx:advice id="txAdvice" transaction-manager="transactionManager">
74-
<tx:attributes>
75-
<tx:method name="select*" read-only="true"/>
76-
<tx:method name="find*" read-only="true"/>
77-
<tx:method name="get*" read-only="true"/>
78-
<tx:method name="*"/>
79-
</tx:attributes>
80-
</tx:advice>
71+
<tx:advice id="txAdvice" transaction-manager="transactionManager">
72+
<tx:attributes>
73+
<tx:method name="select*" read-only="true"/>
74+
<tx:method name="find*" read-only="true"/>
75+
<tx:method name="get*" read-only="true"/>
76+
<tx:method name="*"/>
77+
</tx:attributes>
78+
</tx:advice>
8179

82-
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
83-
<property name="dataSource" ref="dataSource"/>
84-
</bean>
80+
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
81+
<property name="dataSource" ref="dataSource"/>
82+
</bean>
8583
</beans>

src/main/resources/mapper/CountryMapper.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,4 @@
77
<select id="selectById" resultType="com.isea533.mybatis.model.Country">
88
select * from country where id = #{id}
99
</select>
10-
<select id="selectAll" resultType="com.isea533.mybatis.model.Country">
11-
select * from country
12-
</select>
1310
</mapper>

0 commit comments

Comments
 (0)