Mybatis 3.5.X的特性与BUG

MyBatis 3.5.X

mybatis-3.5.0

MyBatis 3.5.0 requires Java 8 and later.

改善:

  • Avoid ‘Illegal reflective access’ warning on JDK 9+. #1156
  • Added Automatic-Module-Name : org.mybatis #1199 用于当 mybatis jar 在 Java 9 中被用作自动模块时,确保名称是 org.mybatis
  • Support java.util.Optional as return type of mapper method. #799 支持JDK8新特性Optional
  • Avoid unnecessary wasNull() calls from the built-in type handlers. #1244
  • It is now possible to specify columnPrefix in constructor arguments. #968
  • Improved reliability when searching constructor for auto-mapping. #1277
  • It is now possible to access private, package private and protected members in OGNL expressions. #1258
  • Throw exception if the specified keyProperty is not found when assigning generated keys. #1250
  • Added a type handler for SQLXML data type. #1221
  • Allow accessing private, package private and protected members in OGNL expression. #1258
  • <set /> tag now trims the leading comma. #21 指<set />标签可以自动修剪多余的前缀逗号
  • Infer <case /> tag’s resultType from the enclosing resultMap. #486
  • Allow specifying columnPrefix in constructor mapping. #968
  • Combination of @CacheNamespace and does not throw exception anymore. #1194
  • Support Log4J 2.6+. #1210
  • Slightly improved compatibility with drivers that only support JDBC 3 API. #1386
  • Upgraded testing framework to JUnit 5. #1425

Bug 修复:

  • OffsetDateTimeTypeHandler, OffsetTimeTypeHandler and ZonedDateTimeTypeHandler loses time zone information. #1081
  • Avoid SQLException when using Cursor with Db2. #1345
  • Avoid exception when using Cursor with ReuseExecutor. #1351
  • RowBounds with out-of-range offset causes SQLException on DB2. #1355
  • Specified logging implementation is not used in some classes. #1272
  • Unable to resolve javaType for . #1381
  • Deeply nested (3+ levels) result map could cause IllegalArgumentException. #1176
  • Generic type parameter is not correctly resolved when the class hierarchy is deeper than 3 levels. #1260

不向后兼容的改变(包括3.4.6版本及之前版本)

  • Specifying keyProperty is now mandatory when using useGeneratedKeys. If you relied on the implicit default value (=“id”), generated keys will be silently ignored. #1198
  • Using Cursor now requires a driver that supports JDBC 4.1 API. #1351
  • If you extended org.apache.ibatis.type.BaseTypeHandler, you might need to add wasNull() check in your type handler. #1144
  • The default resultSetType value has been changed from FORWARD_ONLY to UNSET. This is applied only to annotation based mappers (for XML based mappers, the default is/was UNSET). #1334
  • If you extended org.apache.ibatis.transaction.jdbc.JdbcTransaction for some reason, the property autoCommmit has been renamed to autoCommit. #941

mybatis-3.5.1

改善:

  • You can now return ‘script’ from a SQL provider. The returned script is parsed using the language driver specified by @Lang. #1391
  • You can now omit method attribute from SQL provider annotations when the provider method has the same name as the mapper method or its name is provideSql. #1279
  • You can now get databaseId in SQL providers. #1503
  • The default type handler for LONGVARCHAR is changed from ClobTypeHandler to StringTypeHandler. This improves compatibility with SAP ASE. #1484

Bug 修复:

  • keyProperty specified with parameter name could cause ExecutorException. #1485
  • False positive error ‘Ambiguous collection type …’ . #1472
  • EnumTypeHandler is not used when the enum has methods. #1489
  • Auto-mapping fails in a result map referenced from a constructor arg with columnPrefix. #1496
  • Constructor auto-mapping could fail when columnPrefix is specified in the parent result map. #1495
  • LocalTimeTypeHandler loses fractional seconds part. #1478
  • LocalDateTypeHandler and LocalDateTimeTypeHandler could return unexpected value. #1478 修复会导致SQLFeatureNotSupportedException的bug

不向后兼容的修改

  • Because of the fix for #1478 , LocalDateTypeHandler, LocalTimeTypeHandler and LocalDateTimeTypeHandler now require a JDBC driver that supports JDBC 4.2 API.
    Also, these type handlers no longer work with Druid. See #1516 由于Druid的1.1.17版本不支持JDBC 4.1及以上版本,所以LocalDate, LocalTime和数据库DATE之间转换会报SQLFeatureNotSupportedException异常。Druid的1.1.18版本会修复这个问题。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值