Sunday, September 18, 2022

MyBatis 3.5.11 released!

Dear Community,

We are pleased to announce the release of MyBatis 3.5.11.
The below is the list of notable changes.

Bug fixes:
  • OGNL could throw IllegalArgumentException when invoking inherited method. #2609
  • returnInstanceForEmptyRow is not applied to constructor auto-mapping. #2665
There also are many contributions with doc updates and code improvements! Please see the 3.5.11 milestone page for the complete list of changes.
There is no known backward incompatible change since 3.5.10.
Binaries are available on the release page and Maven Central.

We thank everyone reported issues, shared ideas and answered questions from other users! 👏

Sincerely,
The MyBatis Team

Monday, May 23, 2022

MyBatis 3.5.10 released!

Dear Community,

We are pleased to announce the release of MyBatis 3.5.10.
The below is the list of notable changes.

Bug fixes:
  • Unexpected illegal reflective access warning when calling method in `test` expression. #2392
  • IllegalAccessException when auto-mapping Records (JEP-359). #2195
  • 'interrupted' status is not set when `PooledConnection#getConnection()` is interrupted. #2503
Enhancements:
  • A new option `argNameBasedConstructorAutoMapping` is added. If enabled, constructor argument names are used to look up columns when auto-mapping. #2192
  • `<idArg />` can now be listed after `<arg />` in `<constructor />`. #2541
  • Added a new property `skipSetAutoCommitOnClose` to `JdbcTransactionFactory`. Skipping `setAutoCommit()` call could improve performance with some drivers. #2426
There also are many contributions with doc updates and code improvements! Please see the 3.5.10 milestone page for the complete list of changes.
There is no known backward incompatible change since 3.5.9.
Binaries are available on the release page and Maven Central.

We thank everyone reported issues, shared ideas and answered questions from other users! 👏

Sincerely,
The MyBatis Team

Saturday, December 25, 2021

MyBatis 3.5.9 released!

Dear Community,

It has only been two weeks, but we decided to release MyBatis 3.5.9.

List of changes:
  • Add nullable to <collection />. If enabled, it skips the iteration when the collection is null instead of throwing an exception. To enable this feature globally, set nullableOnForEach=true in the config. #1883
We also updated the version of Log4J dependency to 2.17.0.
Note that the scope of Log4J dependency in MyBatis' pom.xml is 'optional' and it is very important for you to understand what it means.
  • You can use MyBatis without Log4J.
  • Adding MyBatis to your project's dependency does not bring in Log4J implicitly.
  • Updating MyBatis version does not make your project safer because it does not affect the Log4J version in your project.
  • Regardless of the MyBatis version you are using, you can/have to update Log4J version independently.
Please see the 3.5.9 milestone page for the complete list of changes.
There is no known backward incompatible change since 3.5.8.
Binaries are available on the release page and Maven Central.

We thank you for your contribution!

Sincerely,
The MyBatis Team

Sunday, December 12, 2021

MyBatis 3.5.8 released!

Dear Community,

We are pleased to announce the release of MyBatis 3.5.8.
The below is the list of notable changes.

List of changes:
  • Avoid `NullPointerException` when mapping an empty string to java.lang.Character. #2368
  • Fixed an incorrect argument when initializing static object. This resolves a compatibility issue with quarkus-mybatis. #2284
  • Performance improvements. #2297 #2335 #2340
  • And many doc updates!
Please see the 3.5.8 milestone page for the complete list of changes.
There is no known backward incompatible change since 3.5.7.
Binaries are available on the release page and Maven Central.

We thank everyone reported issues, shared ideas and answered questions from other users! 👏

Sincerely,
The MyBatis Team

Monday, April 26, 2021

MyBatis 3.5.7 released!

Dear Community,

We are pleased to announce the release of MyBatis 3.5.7.
The below is the list of user visible changes.

Bug fixes:
  • Improved performance under JDK 8. #2223

Please see the 3.5.7 milestone page for the complete list of changes.
Binaries are available on the release page and Maven Central.

We also receive many code and documentation improvements.
Thank you very much for your contributions in various forms!

Sincerely,
The MyBatis Team

Tuesday, October 6, 2020

MyBatis 3.5.6 released!

Dear Community,

We are pleased to announce the release of MyBatis 3.5.6.
The below is the list of user visible changes.

Enhancements:
  • A new configuration option defaultSqlProviderType is added. The specified class will be used as the SQL provider when the value() or type() is not specified in @SelectProvider, @UpdateProvider, @InsertProvider and @DeleteProvider. #1951
  • A new transaction isolation level SQL_SERVER_SNAPSHOT is added to TransactionIsolationLevel enum to support the MS SQL Server specific isolation level SNAPSHOT. #1973
  • When there is no JEP-290 serialization filter defined, a WARN level message is logged on deserializing object streams. #2079
Bug fixes:
  • Possible NoSuchPropertyException under heavy load. #1648
  • Possible InvalidPathException when registering type aliases by specifying package name. #1974
  • Possible OutOfMemoryError when using BlockingCache. #2044

Please see the 3.5.6 milestone page for the complete list of changes.
Binaries are available on the release page and Maven Central.

We also receive many code and documentation improvements.
Thank you very much for your contributions in various forms!

Sincerely,
The MyBatis Team

Tuesday, August 11, 2020

MyBatis and CockroachDB

Several months ago, the team at Cockroach Labs reached out to the MyBatis developers asking if we could talk about officially supporting CockroachDB. CockroachDB is wire compatible with PostgreSQL and CockroachDB clients use the PostgreSQL JDBC driver to connect. The team at Cockroach Labs assumed that making changes in MyBatis to support CockroachDB would be relatively easy.

We had a few conversations and it turns out that we didn't need to make any changes in MyBatis to support CockroachDB. I think this is a great validation of the MyBatis approach to database dialects - we don't have one! MyBatis is able to execute SQL against any database that has a JDBC driver. We leave it fully in the hands of developers to write whatever SQL they need for the target database.

So our work with Cockroach Labs shifted to focus on documentation and examples. Today I'm happy to say that MyBatis has a page on the official Cockroach Labs documentation site here: https://www.cockroachlabs.com/docs/v20.1/build-a-spring-app-with-cockroachdb-mybatis.html

That page shows how to use the MyBatis Spring support to easily work with databases and it's a great example of how far these tools have come. There's no XML anywhere to be found - either for Spring or MyBatis.

You can also read a blog post from Cockroach labs here: https://www.cockroachlabs.com/blog/spring-data-access-tutorials/

I really want to thank the team at Cockroach Labs for helping us get to this point - especially Eric Harmeling, Vy Ton, and Andy Woods who have been great working partners.

Thursday, June 4, 2020

MyBatis 3.5.5 released!

Dear Community,

We are pleased to announce the release of MyBatis 3.5.5.
The below is the list of user visible changes.

Enhancements:
  • You can reference single `List` or `Collection` type parameter using its actual parameter name when `useActualParamName` is enabled. #1237
  • You can specify `resultMap` in `@One` and `@Many`. #1771
  • You can specify `columnPrefix` in `@One` and `@Many`. #1829
  • A new option `shrinkWhitespacesInSql` to remove extra whitespaces in SQL. #1901
Bug fixes:
  • Possible IllegalArgumentException when using `@CacheNamespaceRef` . #1719
  • Mapper method invocation should be non-blocking (work around JDK-8161372). #1929

Please see the 3.5.5 milestone page for the complete list of changes.
Binaries are available on the release page and Maven Central.

We also receive many code and documentation improvements.
Thank you very much for your contributions in various forms!

Sincerely,
The MyBatis Team

Monday, February 3, 2020

MyBatis 3.5.4 released!

Dear Community,

We are pleased to announce the release of MyBatis 3.5.4.
The below is the list of user visible changes.

Enhancements:
  • You can now omit unnecessary `@Results` and `@ConstructorArgs` annotation. #1698
Bugs:
  • Avoid invoking hashCode() method when setting auto-generated keys. #1719
  • Possible ResultMapException when using nested select. #1551
  • Possible incorrect TypeVariable resolution in TypeParameterResolver. #1794
  • Race condition in TypeHandlerRegistry. #1819

Please see the 3.5.4 milestone page for the complete list of changes.
Binaries are available on the release page and Maven Central.

We also receive many code and documentation improvements.
Thank you very much for your contributions in various forms!

Sincerely,
The MyBatis Team

Sunday, October 20, 2019

MyBatis 3.5.3 released!

Dear Community,

We are pleased to announce the release of MyBatis 3.5.3.
The below is the list of user visible changes.

Enhancements:
  • Support variable substitution in CDATA of included <sql />. #1615
  • Support default method invocation on JDK 14+8 or later. #1626
  • Avoid illegal reflective access warning when invoking default mapper method. #1636
  • Ambiguous getter/setter now throws ReflectionException only when it is actually accessed. #1201

Bugs:

  • Possible infinite loop when a SQL provider throws an exception. #1616
  • Unable to iterate Cursor if the next element is null. #1653
  • queryCursor() fails in streaming mode of MySQL Connector/J. #1654

Please see the 3.5.3 milestone page for the complete list of changes.
Binaries are available on the release page and Maven Central.

We also receive many code and documentation improvements.
Thank you very much for your contributions in various forms!

Sincerely,
The MyBatis Team

Monday, July 15, 2019

MyBatis 3.5.2 released!

Dear Community,

We are pleased to announce the release of MyBatis 3.5.2.
The below is the list of user visible changes.

Enhancements:

  • SQL builder now supports LIMIT, OFFSET #1521 and FETCH FIRST #1582.
  • SQL builder now supports multi-row insert syntax #1333.
  • A new property defaultNetworkTimeout has been added to the built-in data sources i.e. PooledDataSource and UnpooledDataSource #1527.
  • SQL provider annotations now takes value attribute which is an alias for type #1522.
  • You can now pass Java array to ArrayTypeHandler#setNonNullParameter() #1548.
  • You can reference single simple type unnamed parameter with any name in OGNL expressions #1487.
  • A new configuration option defaultResultSetType is added #1056.

Bugs:

  • SQL provider method with a primitive parameter causes BuilderException #1604.
  • Fixes a possible NullPointerException #1590.

Please see the 3.5.2 milestone page for the complete list of changes.
Binaries are available on the release page and Maven Central.

There also are various code and documentation improvements.
Thank you very much for your contributions in various forms!

Sincerely,
The MyBatis Team

Monday, April 8, 2019

MyBatis 3.5.1 released!

Dear Community,

We are pleased to announce the release of MyBatis 3.5.1.
The below is the list of user visible changes.

Bug fixes:
  • 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 resultMap. #1495
  • LocalTimeTypeHandler loses fractional seconds part. #1478
  • LocalDateTypeHandler and LocalDateTimeTypeHandler could return unexpected value. #1478
Enhancements:
  • 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. #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
There is one backward incompatible changes since 3.5.0.
  • Because of the fix for #1478 , LocalDateTypeHandler, LocalTimeTypeHandler and LocalDateTimeTypeHandler now require a JDBC driver that supports JDBC 4.2 API.
    [EDIT] These type handlers no longer work with Druid. Please see #1516 .
To see the full list of changes, please visit the 3.5.1 milestone page.
Binaries are available on the release page and Maven Central.

Thank you all for your contributions in various forms!

Sincerely,
The MyBatis Team

Sunday, January 20, 2019

MyBatis 3.5.0 released!

Dear Community,

We are pleased to announce the release of MyBatis 3.5.0.
This version requires Java version 8 and later.

The below is the list of user visible changes.

Enhancements:
  • Avoid 'Illegal reflective access' warning on JDK 9+. #1156
  • Added Automatic-Module-Name : org.mybatis #1199
  • Support java.util.Optional as return type of mapper method. #799
  • 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
  • <set /> tag now trims the leading comma. #21
  • Infer <case /> tag's resultType from the enclosing resultMap. #486
  • Combination of @CacheNamespace and <cache-ref /> 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 fixes:
  • 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 <association />. #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
Please be aware that there also are some backward incompatible changes since the last release 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. #1244
  • 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
Please see the 3.5.0 milestone page for the complete list of changes.
Binaries are available on the release page and Maven Central.

As always, we thank all contributors who reported issues, sent pull requests or participated in discussions!
And stay tuned for our sub-projects' updates!

Sincerely,
The MyBatis Team

Sunday, October 14, 2018

MyBatis Migrations 3.3.5 released!

Dear Community,

We are pleased to announce the release of MyBatis-Migrations 3.3.5.

Enhancements:
  • 'bofore_new' and 'after_new' hooks. #106
  • Print a warning when there is a skipped migration or a missing migration script. #125
Bug fixes:
  • Possible ArrayIndexOutOfBoundsException when reading a script. #127
  • 'script' command can generate incomplete script. #121
Follow this link to see the full list of changes.
Binaries are available on the release page and Maven Central.

Many thanks to those who reported issues, sent pull requests or participated in discussions!

Sincerely,
The MyBatis Team

Tuesday, July 24, 2018

MyBatipse (Eclipse plugin) 1.1.2 is released!

Dear MyBatis - Eclipse users,

We have released version 1.1.2 of MyBatipse.

Two bug fixes and a new feature:
  • It now supports two or more XML mapper files having the same namespace. #86
  • Hyperlink now works in binary class editor. #84
  • Hyperlink now works on 'property' attribute of @Results. #85
Please see the GitHub page for the general information.

The next version of the plugin may require Java 8 and Eclipse 4.6 (Neon).

Enjoy!

Wednesday, July 4, 2018

MyBatis Generator 1.3.7 Released

There is a new release of MyBatis Generator and a new version of the Eclipse feature is also available. This release has a few relatively minor bug fixes and enhancements - mainly related to minor issues with the new MyBatis Dynamic SQL support.

Important: after this release, Java 8+ will be required to run the generator, and support for iBatis 2 code generation will be removed.

Detailed information about the release is on GitHub here: https://github.com/mybatis/generator/releases
The artifacts are in Maven central now, and the Eclipse update site has the new version as well.

The Eclipse marketplace site is here: http://marketplace.eclipse.org/content/mybatis-generator
Enjoy!

Wednesday, April 25, 2018

MyBatis Dynamic SQL 1.1.0 Released

Dear Community,

We are pleased to announce the release of MyBatis Dynamic SQL Version 1.1.0.

This version has quite a few enhancements and two bug fixes. The most important enhancement is the addition of optional conditionals.  This support allows you to code a WHERE clause that can vary based on the input values to the conditions.  This can be very useful for coding searches where, for example, a conditional should only be rendered if the value is non-null.  This type of support has been requested for quite some time in code created from MyBatis Generator.  It wasn't feasible to do it with code generated in the old style, but is a natural addition to the MyBatis Dynamic SQL library.

You can find all the details on the GitHub release page.

Enjoy!


Wednesday, March 14, 2018

MyBatis-Spring-Boot 1.3.2 released!

Dear Community,

We are pleased to announce the release of MyBatis-Spring-Boot 1.3.2.
Here is the list of main changes.

Enhancements:
  • Upgrade to Spring Boot 1.5.10 #220
  • Upgrade to MyBatis 3.4.6 #212
  • Upgrade to MyBatis-Spring 1.3.2 #213

There is no known backward incompatible change since 1.3.1.
Follow this link to see the full list of changes.

It is available on https://start.spring.io/.

Thanks,
The MyBatis Team

MyBatis-Migrations 3.3.2 released!

Dear Community,

NOTE
There was a regression in version 3.3.2 (#117) .
Please use version 3.3.3.

We are pleased to announce the release of MyBatis-Migrations 3.3.2.

Enhancements:
  • Added '--quiet' command line option. #92
  • Added '--color' command line option. #104
  • It is now possible to specify multiple characters as a delimiter. #96
  • Hooks are now applied to 'version' and 'pending' commands as well. #81
  • Added a new environment option 'ignore_warnings'. #85
  • Migrations can now use a custom FileMigrationsLoader. #107
  • Reduced memory usage when reading a large migration script. #101
The default value of 'ignore_warnings' is 'true', so SQL warnings do not stop migration as they did in 3.3.1. See #85 for more info.

Follow this link to see the full list of changes.
Binaries are available on the release page and Maven Central.

Many thanks to those who reported issues, sent pull requests or participated in discussions!

Sincerely,
The MyBatis Team

MyBatis-Spring 1.3.2 released!

Dear Community,

We are pleased to announce the release of MyBatis-Spring 1.3.2.
Here is the list of main changes.

Bug fixes:
  • Possible occur NullpointerException on MyBatisCursorItemReader when close. #237
Enhancements:
  • Supports MyBatis 3.4.6 #279
  • Supports Spring Framework 4.3.14 #288
  • Spring Batch 3.0.9 #290

There is no known backward incompatible change since 1.3.1.
Follow this link to see the full list of changes.
Binaries are available on the release page and Maven Central.

Thanks,
The MyBatis Team