Skip to content

Commit 6472c8a

Browse files
committed
3.2.0-SNAPSHOT
1 parent 3d5dc7e commit 6472c8a

File tree

4 files changed

+29
-16
lines changed

4 files changed

+29
-16
lines changed

pom.xml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>tk.mybatis</groupId>
66
<artifactId>mapper</artifactId>
7-
<version>3.1.3</version>
7+
<version>3.2.0-SNAPSHOT</version>
88
<packaging>jar</packaging>
99

1010
<name>mapper</name>
@@ -42,6 +42,27 @@
4242
<artifactId>persistence-api</artifactId>
4343
<version>1.0</version>
4444
</dependency>
45+
<dependency>
46+
<groupId>org.mybatis</groupId>
47+
<artifactId>mybatis-spring</artifactId>
48+
<version>1.2.1</version>
49+
<scope>compile</scope>
50+
<optional>true</optional>
51+
</dependency>
52+
<dependency>
53+
<groupId>org.springframework</groupId>
54+
<artifactId>spring-context</artifactId>
55+
<version>3.2.12.RELEASE</version>
56+
<scope>compile</scope>
57+
<optional>true</optional>
58+
</dependency>
59+
<dependency>
60+
<groupId>org.springframework</groupId>
61+
<artifactId>spring-tx</artifactId>
62+
<version>3.2.12.RELEASE</version>
63+
<scope>compile</scope>
64+
<optional>true</optional>
65+
</dependency>
4566

4667
<!--可选依赖-->
4768
<dependency>

src/main/java/tk/mybatis/mapper/mapperhelper/MapperHelper.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ public class MapperHelper {
5757
* 缓存msid和MapperTemplate
5858
*/
5959
private Map<String, MapperTemplate> msIdCache = new HashMap<String, MapperTemplate>();
60-
/**
61-
* 缓存已经处理过的Collection<MappedStatement>
62-
*/
63-
private Set<Collection<MappedStatement>> collectionSet = new HashSet<Collection<MappedStatement>>();
6460
/**
6561
* 是否使用的Spring
6662
*/
@@ -570,12 +566,6 @@ public void setProperties(Properties properties) {
570566
*/
571567
public void processConfiguration(Configuration configuration) {
572568
Collection<MappedStatement> collection = configuration.getMappedStatements();
573-
//防止反复处理一个
574-
if (collectionSet.contains(collection)) {
575-
return;
576-
} else {
577-
collectionSet.add(collection);
578-
}
579569
int size = collection.size();
580570
Iterator<?> iterator = collection.iterator();
581571
while (iterator.hasNext()) {

src/main/java/tk/mybatis/mapper/mapperhelper/MapperInterceptor.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@
3636
/**
3737
* 通用Mapper拦截器
3838
*
39+
* @deprecated 使用MapperHelper直接配置效果更好
3940
* @author liuzh
4041
*/
42+
@Deprecated
4143
@Intercepts({
4244
@Signature(type = Executor.class, method = "query", args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class}),
4345
@Signature(type = Executor.class, method = "update", args = {MappedStatement.class, Object.class})

src/test/java/tk/mybatis/mapper/mapper/MybatisJavaHelper.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@ public class MybatisJavaHelper {
3939
// 设置UUID生成策略
4040
// 配置UUID生成策略需要使用OGNL表达式
4141
// 默认值32位长度:@java.util.UUID@randomUUID().toString().replace("-", "")
42-
mapperHelper.setUUID("");
42+
//mapperHelper.setUUID("");
4343
// 主键自增回写方法,默认值MYSQL,详细说明请看文档
4444
mapperHelper.setIDENTITY("HSQLDB");
4545
// 序列的获取规则,使用{num}格式化参数,默认值为{0}.nextval,针对Oracle
4646
// 可选参数一共3个,对应0,1,2,分别为SequenceName,ColumnName, PropertyName
47-
mapperHelper.setSeqFormat("NEXT VALUE FOR {0}");
47+
//mapperHelper.setSeqFormat("NEXT VALUE FOR {0}");
4848
// 设置全局的catalog,默认为空,如果设置了值,操作表时的sql会是catalog.tablename
49-
mapperHelper.setCatalog("");
49+
//mapperHelper.setCatalog("");
5050
// 设置全局的schema,默认为空,如果设置了值,操作表时的sql会是schema.tablename
5151
// 如果同时设置了catalog,优先使用catalog.tablename
52-
mapperHelper.setSchema("");
52+
//mapperHelper.setSchema("");
5353
// 主键自增回写方法执行顺序,默认AFTER,可选值为(BEFORE|AFTER)
54-
mapperHelper.setOrder("AFTER");
54+
//mapperHelper.setOrder("AFTER");
5555
// 注册通用Mapper接口 - 可以自动注册继承的接口
5656
mapperHelper.registerMapper(Mapper.class);
5757
mapperHelper.registerMapper(HsqldbMapper.class);

0 commit comments

Comments
 (0)