Skip to content

Commit df733cf

Browse files
committed
3.3.7
1 parent abee7d4 commit df733cf

File tree

6 files changed

+21
-9
lines changed

6 files changed

+21
-9
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Country代码:
9292
<dependency>
9393
<groupId>tk.mybatis</groupId>
9494
<artifactId>mapper</artifactId>
95-
<version>3.3.6</version>
95+
<version>3.3.7</version>
9696
</dependency>
9797
```
9898

@@ -108,7 +108,13 @@ http://repo1.maven.org/maven2/javax/persistence/persistence-api/1.0/
108108

109109
##[更新日志](http://git.oschina.net/free/Mapper/blob/master/wiki/Changelog.md)
110110

111-
##最新版本3.3.6 - 2016-02-20
111+
##最新版本3.3.7 - 2016-03-21
112+
113+
* `Example`增加`orderBy`方法,使用属性进行排序,例如:`example.orderBy("id").desc().orderBy("countryname").orderBy("countrycode").asc();`
114+
* 当实体类包含数组类型的字段时,在`resultMap`中不使用`javaType`,这种情况如果出错,可以通过`@ColumnType`注解设置`jdbcType` #103
115+
* 实体类中忽略`transient`类型的字段#106
116+
117+
###3.3.6 - 2016-02-20
112118

113119
* 增加对mybatis-spring 1.2.4版本的支持,兼容之前的版本
114120

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
<groupId>tk.mybatis</groupId>
3030
<artifactId>mapper</artifactId>
31-
<version>3.3.6</version>
31+
<version>3.3.7</version>
3232
<packaging>jar</packaging>
3333

3434
<name>mapper</name>

src/main/java/tk/mybatis/mapper/entity/EntityColumn.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,10 @@ public String getColumnHolder(String entityName, String suffix, String separator
252252
if (this.jdbcType != null) {
253253
sb.append(",jdbcType=");
254254
sb.append(this.jdbcType.toString());
255-
}
256-
if (this.typeHandler != null) {
255+
} else if (this.typeHandler != null) {
257256
sb.append(",typeHandler=");
258257
sb.append(this.typeHandler.getCanonicalName());
259-
}
260-
if (this.jdbcType == null && this.typeHandler == null) {
258+
} else if (!this.javaType.isArray()) {//当类型为数组时,不设置javaType#103
261259
sb.append(",javaType=");
262260
sb.append(javaType.getCanonicalName());
263261
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ private void _getFields(Class<?> entityClass, List<EntityField> fieldList, Map<S
285285
Field[] fields = entityClass.getDeclaredFields();
286286
int index = 0;
287287
for (Field field : fields) {
288-
if (!Modifier.isStatic(field.getModifiers())) {
288+
//忽略static和transient字段#106
289+
if (!Modifier.isStatic(field.getModifiers()) && !Modifier.isTransient(field.getModifiers())) {
289290
EntityField entityField = new EntityField(field, null);
290291
if (field.getGenericType() != null && field.getGenericType() instanceof TypeVariable) {
291292
if (genericMap == null || !genericMap.containsKey(((TypeVariable) field.getGenericType()).getName())) {

src/test/java/tk/mybatis/mapper/test/example/TestSelectByExample.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import tk.mybatis.mapper.mapper.MybatisHelper;
3535
import tk.mybatis.mapper.model.Country;
3636

37+
import java.util.ArrayList;
3738
import java.util.Arrays;
3839
import java.util.List;
3940

@@ -49,7 +50,7 @@ public void testSelectByExample() {
4950
CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
5051
Example example = new Example(Country.class);
5152
example.createCriteria().andGreaterThan("id", 100).andLessThan("id",151);
52-
example.or().andLessThan("id",41);
53+
example.or().andLessThan("id", 41);
5354
List<Country> countries = mapper.selectByExample(example);
5455
//查询总数
5556
Assert.assertEquals(90, countries.size());

wiki/Changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#更新日志
22

3+
##3.3.7 - 2016-03-21
4+
5+
* `Example`增加`orderBy`方法,使用属性进行排序,例如:`example.orderBy("id").desc().orderBy("countryname").orderBy("countrycode").asc();`
6+
* 当实体类包含数组类型的字段时,在`resultMap`中不使用`javaType`,这种情况如果出错,可以通过`@ColumnType`注解设置`jdbcType` #103
7+
* 实体类中忽略`transient`类型的字段#106
8+
39
##3.3.6 - 2016-02-20
410

511
* 增加对mybatis-spring 1.2.4版本的支持,兼容之前的版本

0 commit comments

Comments
 (0)