File tree Expand file tree Collapse file tree 6 files changed +12
-6
lines changed
src/test/java/tk/mybatis/mapper Expand file tree Collapse file tree 6 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ Country代码:
88
88
<dependency >
89
89
<groupId >tk.mybatis</groupId >
90
90
<artifactId >mapper</artifactId >
91
- <version >3.3.9 </version >
91
+ <version >3.4.0 </version >
92
92
</dependency >
93
93
```
94
94
如果你使用 Spring Boot 可以直接引入:
Original file line number Diff line number Diff line change 28
28
29
29
<groupId >tk.mybatis</groupId >
30
30
<artifactId >mapper</artifactId >
31
- <version >3.4.0-SNAPSHOT </version >
31
+ <version >3.4.0</version >
32
32
<packaging >jar</packaging >
33
33
34
34
<name >mapper</name >
Original file line number Diff line number Diff line change 24
24
25
25
package tk .mybatis .mapper .model ;
26
26
27
+ import javax .persistence .GeneratedValue ;
28
+ import javax .persistence .GenerationType ;
27
29
import javax .persistence .Id ;
28
30
29
31
/**
33
35
*/
34
36
public class Country2 {
35
37
@ Id
38
+ @ GeneratedValue (strategy = GenerationType .IDENTITY )
36
39
private Integer id ;
37
40
private String countryname ;
38
41
private String countrycode ;
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ public void testDynamicInsertAll() {
50
50
Country2Mapper mapper = sqlSession .getMapper (Country2Mapper .class );
51
51
Country2 country2 = new Country2 ();
52
52
country2 .setCountrycode ("CN" );
53
+ country2 .setId (100 );
53
54
Assert .assertEquals (1 , mapper .insert (country2 ));
54
55
55
56
country2 = mapper .select (country2 ).get (0 );
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ public void testDynamicInsertAll() {
65
65
/**
66
66
* 不能插入null
67
67
*/
68
- @ Test (expected = PersistenceException .class )
68
+ @ Test // (expected = PersistenceException.class)
69
69
public void testDynamicInsertSelectiveAllByNull () {
70
70
SqlSession sqlSession = MybatisHelper .getSqlSession ();
71
71
try {
Original file line number Diff line number Diff line change 1
1
#更新日志
2
2
3
- ##3 .4.0-SNAPSHOT - 2017-01-xx
3
+ ##3 .4.0 - 2017-02-19
4
4
5
5
* ` Example ` 增加 for update 支持,仅能用于 selectByExample 和 selectCountByExample 方法 #210
6
6
* ` Example.Criteria ` 增加 ` andAllEqualTo ` 方法,将此对象的所有字段参数作为相等查询条件,如果字段为 null,则为 is null #206
7
7
* 增加参数 ` checkExampleEntityClass ` ,默认 ` false ` 用于校验通用 Example 构造参数 entityClass 是否和当前调用的 Mapper<EntityClass > 类型一致 #201
8
8
* 增加参数 ` useSimpleType ` ,默认 ` false ` ,启用后判断实体类属性是否为表字段时校验字段是否为简单类型,如果不是就忽略该属性,这个配置优先级高于所有注解
9
9
* 增加参数 ` simpleTypes ` ,默认的简单类型在 ` SimpleTypeUtil ` 中,使用该参数可以增加额外的简单类型,通过逗号隔开的全限定类名添加
10
10
* 所有 ` RuntimeException ` 异常改为 ` tk.mybatis.mapper.MapperException ` 异常
11
-
12
- * 增加配置查询时的分隔符
11
+ * 所有 Update 方法添加 ` @Options(useCache = false, useGeneratedKeys = false) ` ,fix #216
12
+ * 使用自定义的 ` SelectKeyGenerator ` ,防止有默认值时被替换掉 fix #213
13
+ * 将 MapperTemplate 属性改为 protected
14
+ * MBG 插件中 generatedKey 元素的 sqlStatement 属性可以配置为形如 select SEQ_ {1} from dual 的 SQL,其中 {0} 代表小写的表名,{1} 是大写的表名
13
15
14
16
##3 .3.9 - 2016-09-04
15
17
You can’t perform that action at this time.
0 commit comments