# 2021年11月2日 - 1.0.3 发布了🎉🎉🎉
mybatis-mapper 项目升级为 1.0.3:
- mybatis-common 项目中缺少默认语言包,已经将中文设置为默认语言包。
- 解决
Example
中的orderBy
多次时连接字符串错误的 BUG,增加多个方便使用的orderBy
方法。 - 修复 Example.selectColumns 关键词列名的Bug #16 by ydq (opens new window)
- Example 系列方法 支持拼接单层级的 OR 条件 #17 by ydq (opens new window)
尝试性的支持 #15 单层级(不支持 andOr() 条件里面 继续嵌套更细粒度的 andOr() )的 or 条件拼接输出SQL(支持 select 和 update):
//example: UserMapper2 mapper = sqlSession.getMapper(UserMapper2.class); Example<User> example = mapper.example(); example.createCriteria() .andEqualTo(User::getSex,"男") .andOr(example.orPart() .andLike(User::getUserName,"杨%"), example.orPart() .andLike(User::getUserName,"俞%") .andLike(User::getUserName,"%舟"));
xxx WHERE ( sex = ? AND ( ( name LIKE ? ) OR ( name LIKE ? AND name LIKE ? ) ) )
Fn<T, R>
功能优化,增加缓存,支持引用父类方法,示例如下:public static class BaseId { @Entity.Column(id = true) private Long id; public Long getId() { return id; } public void setId(Long id) { this.id = id; } } public static class BaseEntity extends BaseId { @Entity.Column(value = "when_create", jdbcType = JdbcType.TIMESTAMP) private Long whenCreate; public Long getWhenCreate() { return whenCreate; } public void setWhenCreate(Long whenCreate) { this.whenCreate = whenCreate; } } @Entity.Table("sys_user") public static class SysUser extends BaseEntity { @Entity.Column("name") private String userName; public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } } @Entity.Table("sys_role") public class SysRole extends BaseEntity { @Entity.Column("name") private String roleName; public String getRoleName() { return roleName; } public void setRoleName(String roleName) { this.roleName = roleName; } } @Test public void testExtends() { Assert.assertEquals("id", ((Fn<SysUser, Object>) SysUser::getId).toField()); Assert.assertEquals("id", ((Fn<SysUser, Object>) SysUser::getId).toColumn()); Assert.assertEquals("whenCreate", ((Fn<SysUser, Object>) SysUser::getWhenCreate).toField()); Assert.assertEquals("when_create", ((Fn<SysUser, Object>) SysUser::getWhenCreate).toColumn()); Assert.assertEquals("userName", ((Fn<SysUser, Object>) SysUser::getUserName).toField()); Assert.assertEquals("name", ((Fn<SysUser, Object>) SysUser::getUserName).toColumn()); Assert.assertEquals("id", ((Fn<SysRole, Object>) SysRole::getId).toField()); Assert.assertEquals("id", ((Fn<SysRole, Object>) SysRole::getId).toColumn()); Assert.assertEquals("whenCreate", ((Fn<SysRole, Object>) SysRole::getWhenCreate).toField()); Assert.assertEquals("when_create", ((Fn<SysRole, Object>) SysRole::getWhenCreate).toColumn()); Assert.assertEquals("roleName", ((Fn<SysRole, Object>) SysRole::getRoleName).toField()); Assert.assertEquals("name", ((Fn<SysRole, Object>) SysRole::getRoleName).toColumn()); }
# 2021年10月24日 - 1.0.2 发布 😕
核心项目 mybatis-provider 项目升级到 1.0.2,解决下面两个问题:
- 字段名关键词bug,当配置如
column="[order]"
时,会出现[order] AS order
,导致SQL关键字出错。by darren EntityTable
处理列时加锁,避免并发时多次执行。
- 字段名关键词bug,当配置如
【已废弃】mybatis-mapper 项目升级为 1.0.2:
- mybatis-common 项目中缺少默认语言包,已经将中文设置为默认语言包。
- 解决
Example
中的orderBy
多次时连接字符串错误的 BUG,增加多个方便使用的orderBy
方法。
mybatis-mapper 1.0.2没有合并develop分支,因此上述两个更新内容都没包含,因此不要使用该版本。
mybatis-provider 1.0.2 版本正常,可以使用。