Skip to content

Commit

Permalink
3.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
abel533 committed Mar 12, 2016
1 parent abee7d4 commit df733cf
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 9 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Country代码:
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper</artifactId>
<version>3.3.6</version>
<version>3.3.7</version>
</dependency>
```

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

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

##最新版本3.3.6 - 2016-02-20
##最新版本3.3.7 - 2016-03-21

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

###3.3.6 - 2016-02-20

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

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<groupId>tk.mybatis</groupId>
<artifactId>mapper</artifactId>
<version>3.3.6</version>
<version>3.3.7</version>
<packaging>jar</packaging>

<name>mapper</name>
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/tk/mybatis/mapper/entity/EntityColumn.java
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,10 @@ public String getColumnHolder(String entityName, String suffix, String separator
if (this.jdbcType != null) {
sb.append(",jdbcType=");
sb.append(this.jdbcType.toString());
}
if (this.typeHandler != null) {
} else if (this.typeHandler != null) {
sb.append(",typeHandler=");
sb.append(this.typeHandler.getCanonicalName());
}
if (this.jdbcType == null && this.typeHandler == null) {
} else if (!this.javaType.isArray()) {//当类型为数组时,不设置javaType#103
sb.append(",javaType=");
sb.append(javaType.getCanonicalName());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ private void _getFields(Class<?> entityClass, List<EntityField> fieldList, Map<S
Field[] fields = entityClass.getDeclaredFields();
int index = 0;
for (Field field : fields) {
if (!Modifier.isStatic(field.getModifiers())) {
//忽略static和transient字段#106
if (!Modifier.isStatic(field.getModifiers()) && !Modifier.isTransient(field.getModifiers())) {
EntityField entityField = new EntityField(field, null);
if (field.getGenericType() != null && field.getGenericType() instanceof TypeVariable) {
if (genericMap == null || !genericMap.containsKey(((TypeVariable) field.getGenericType()).getName())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import tk.mybatis.mapper.mapper.MybatisHelper;
import tk.mybatis.mapper.model.Country;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

Expand All @@ -49,7 +50,7 @@ public void testSelectByExample() {
CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
Example example = new Example(Country.class);
example.createCriteria().andGreaterThan("id", 100).andLessThan("id",151);
example.or().andLessThan("id",41);
example.or().andLessThan("id", 41);
List<Country> countries = mapper.selectByExample(example);
//查询总数
Assert.assertEquals(90, countries.size());
Expand Down
6 changes: 6 additions & 0 deletions wiki/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#更新日志

##3.3.7 - 2016-03-21

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

##3.3.6 - 2016-02-20

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

0 comments on commit df733cf

Please sign in to comment.