Releases: mybatis/mybatis-dynamic-sql
MyBatis Dynamic SQL Release 1.5.2
This is a small maintenance release with the following changes:
- Improvements to the Kotlin DSL for CASE expressions (infix methods for "else" and "then"). See this PR for
details: #785 - Potentially Breaking Change: the "in" conditions ("isIn", "isNotIn", "isInCaseInsensitive",
"isNotInCaseInsensitive") will now render if the input list of values is empty. This will lead
to a runtime exception. This change was made out of an abundance of caution and is the safest choice.
If you wish to allow "in" conditions to be removed from where clauses when the list is empty,
then use the "when present" versions of those conditions. If you are unsure how this works, please
read the documentation here: https://mybatis.org/mybatis-dynamic-sql/docs/conditions.html#optionality-with-the-%E2%80%9Cin%E2%80%9D-conditions
For background on the reason for the change, see the discussion in issue #788
Important: This is the last release that will be compatible with Java 8.
The full list of changes is available here: https://github.com/mybatis/mybatis-dynamic-sql/milestone/14?closed=1
Please find the full release notes here: https://mybatis.org/mybatis-dynamic-sql/docs/CHANGELOG.html
All artifacts are available in Maven central under these coordinates:
<dependency>
<groupId>org.mybatis.dynamic-sql</groupId>
<artifactId>mybatis-dynamic-sql</artifactId>
<version>1.5.2</version>
</dependency>
MyBatis Dynamic SQL Release 1.5.1
This is a minor release with a few enhancements. The most important enhancement is that the library now supports CASE expressions in select statements. The rendering process was also refactored significantly. This should have no impact on most users.
Important: This is the last release that will be compatible with Java 8.
The full list of changes is available here: https://github.com/mybatis/mybatis-dynamic-sql/milestone/13?closed=1
Please find the full release notes here: https://mybatis.org/mybatis-dynamic-sql/docs/CHANGELOG.html
All artifacts are available in Maven central under these coordinates:
<dependency>
<groupId>org.mybatis.dynamic-sql</groupId>
<artifactId>mybatis-dynamic-sql</artifactId>
<version>1.5.1</version>
</dependency>
MyBatis Dynamic SQL Release 1.5.0
This release includes many new features and one potential breaking change.
In addition, much of the deprecated code in prior releases was removed.
Potentially Breaking Change
If you create reusable where clauses with the library, and use the WhereSupplier
class, the syntax has changed. This change was required when we added support for having
clauses (see below). Please see the release notes for full details.
New Features
- Add support for
having
clauses. Having clauses have the same syntax and capabilities as where clauses. You can also write standalone having clauses if you have a need to reuse them. - Add "multi select" queries - where multiple complete select statements - including order by and limit clauses - can be composed in a union query
- Add a new "map to row" function in insert, batch insert, and multi-row insert statements that allows you to insert a simple object like Integer or String - or a list of simple objects
- Several other enhancements detailed in the release notes
The full list of changes is available here: https://github.com/mybatis/mybatis-dynamic-sql/milestone/12?closed=1
Please read the full release notes for details: https://mybatis.org/mybatis-dynamic-sql/docs/CHANGELOG.html#release-1-5-0-april-21-2023
All artifacts are available in Maven central under these coordinates:
<dependency>
<groupId>org.mybatis.dynamic-sql</groupId>
<artifactId>mybatis-dynamic-sql</artifactId>
<version>1.5.0</version>
</dependency>
MyBatis Dynamic SQL Release 1.4.1
This maintenance release includes a few new features and one important change.
The next release of the library will be version 1.5.0 and we will remove all deprecated code in that release.
Potentially Breaking Change
The library will now throw a NonRenderingWhereClauseException
if a where clause is coded in any statement, but fails to render because all optional conditions have been dropped. We have made this change out of an abundance of caution to prevent statements that accidentally impact all rows in a table (for example, a delete statement could delete all rows in a table).
The default behavior can be modified either through global configuration, or on a statement by statement basis. Please see the documentation page about library configuration for details here: https://mybatis.org/mybatis-dynamic-sql/docs/configuration.html.
New Features
- Improve the arbitrary grouping in where clauses - virtually any where clause should now be possible
- Add the ability to specify a table alias on delete and update statements - this improves those statements by allowing a correlated sub query
- Some minor updates to the Kotlin DSL
- Added some checks for invalid SQL
- Standardized all exceptions thrown by the library to be either
DynamicSqlException
or some subclass ofDynamicSqlException
The full list of changes is available here: https://github.com/mybatis/mybatis-dynamic-sql/issues?q=milestone%3A1.4.1+
Please read the full release notes for details: https://mybatis.org/mybatis-dynamic-sql/docs/CHANGELOG.html
All artifacts are available in Maven central under these coordinates:
<dependency>
<groupId>org.mybatis.dynamic-sql</groupId>
<artifactId>mybatis-dynamic-sql</artifactId>
<version>1.4.1</version>
</dependency>
MyBatis Dynamic SQL Release 1.4.0
This release includes the following enhancements:
- Add support for arbitrary grouping of conditions in a where clause, and "not" conditions. Any where clause should be possible with this change.
- Improvements to table alias calculation that will make sub queries in where clauses easier
- Removal of some deprecated code
- Major update to Kotlin DSL:
- The where clause DSL is rewritten and more closely matches native SQL
- Kotlin where clauses also support arbitrary grouping and "not" conditions
- All insert statements now have native Kotlin builders
- Many other small improvements using Kotlin DSL building functions
With this release, the Kotlin DSL is very close to native SQL. It is awesome - give it a try!
All artifacts are available in Maven central under these coordinates:
<dependency>
<groupId>org.mybatis.dynamic-sql</groupId>
<artifactId>mybatis-dynamic-sql</artifactId>
<version>1.4.0</version>
</dependency>
MyBatis Dynamic SQL Release 1.3.1
This minor release includes the following enhancements:
- Add support for setting a JavaType in an
SqlColumn
. The type will be rendered properly for MyBatis - Add support for setting a table alias in a new
AliasableSqlTable
meta-model class - Add a few missing
groupBy
andorderBy
methods on the SELECT statement
The full list of changes is available here: https://github.com/mybatis/mybatis-dynamic-sql/issues?q=milestone%3A1.3.1+
All artifacts are available in Maven central under these coordinates:
<dependency>
<groupId>org.mybatis.dynamic-sql</groupId>
<artifactId>mybatis-dynamic-sql</artifactId>
<version>1.3.1</version>
</dependency>
MyBatis Dynamic SQL Release 1.3.0
This release includes the following major enhancements:
- Add support for subqueries in select statements
- Add support for the "exists" and "not exists" operators in where clauses
- Rafactoring and improvement of the built-in conditions including support for chained "filter" and "map" methods
- Major improvements to the Kotlin DSL
There are many other minor updates, and deprecated code from prior releases has been removed.
The full list of changes is available here: https://github.com/mybatis/mybatis-dynamic-sql/issues?q=milestone%3A1.3.0+
Important Note: This release contains two breaking changes that might impact some users in rare cases. Please read the full release notes for details: https://mybatis.org/mybatis-dynamic-sql/docs/CHANGELOG.html
All artifacts are available in Maven central under these coordinates:
<dependency>
<groupId>org.mybatis.dynamic-sql</groupId>
<artifactId>mybatis-dynamic-sql</artifactId>
<version>1.3.0</version>
</dependency>
MyBatis Dynamic SQL Release 1.2.1
This small release contains the following bug fix:
- Fixed a bug where the "in" conditions could render incorrectly in an unusual corner case
And the following enhancements:
- Added utility mappers for MyBatis for common CRUD operations. These mappers can be used as-is with MyBatis, or they can be extended and further refined. MyBatis Generator will likely be updated to use these common mappers.
- Added the ability to add a callback to be executed when an "in" condition is empty at rendering time. Empty "in" conditions will be dropped from the rendered where clause. We also removed the option added last release to force the library to render invalid "in" conditions
- Refactored the aggregates to use the new base function classes. There is no real difference between an aggregate and a function, and this will allow us to add HAVING support to the select statement in a future release
There are a few other small changes. You can see the full list here: https://github.com/mybatis/mybatis-dynamic-sql/issues?q=milestone%3A1.2.1+
All artifacts are available in Maven central under these coordinates:
<dependency>
<groupId>org.mybatis.dynamic-sql</groupId>
<artifactId>mybatis-dynamic-sql</artifactId>
<version>1.2.1</version>
</dependency>
MyBatis dynamic SQL Version 1.2.0
This release has a few major themes:
- The Kotlin DSL has been improved so that it supports the full capabilities of the underlying Java DSL - most notably in that it now supports union queries.
- There are major improvements to the support for Spring NamedParameterJDBCTemplate. In both Java and Kotlin, we now support the full capabilities of the library with Spring. Notable improvements include:
- All statement types (including multi-row inserts) will render properly and we've added a utility class for Java similar to what was already available in the Kotlin extension methods.
- We now support retrieval of generated key for most insert statements in Spring, and have added support for generted key retrieval to the Kotlin DSL
- There is a new capability to convert parameter values before they are placed in a parameter Map. This is similar to a MyBatis type handler, but it is very useful for Spring. It enables you to use more complex types in your model classes, but convert those types to something Spring understands before executing the generated SQL
- There is a new "general insert" statement that does not require a backing POJO. This can be used for both MyBatis and Spring, but it works very well in Spring in conjunction with the new parameter conversion support
- The function base classes have been improved so that it is easier to create your own functions to add capabilities to the library that aren't supported natively.
Several methods - especially some insert methods - have been deprecated in favor of more consistency across all runtimes and languages. All deprecated methods have direct replacements. All deprecated code will be removed in the next release.
There are quite a few other improvements. You can see the full list here: https://github.com/mybatis/mybatis-dynamic-sql/issues?q=milestone%3A1.2.0+
All artifacts are available in Maven central under these coordinates:
<dependency>
<groupId>org.mybatis.dynamic-sql</groupId>
<artifactId>mybatis-dynamic-sql</artifactId>
<version>1.2.0</version>
</dependency>
MyBatis dynamic SQL Version 1.1.4
This release has two enhancements:
- Add support for sharing where clauses between count, delete, select, and update statements
- Improve the Kotlin DSL - removed some extension methods which caused ambiguities and added custom builders
Also fixed one bug:
- Fixed bug where uses of limit/offset/fetch first in sub queries would cause a parameter name collision
Detail about these changes can be viewed here:
https://github.com/mybatis/mybatis-dynamic-sql/issues?q=is%3Aclosed+milestone%3A1.1.4
All artifacts are available in Maven central under these coordinates:
<dependency>
<groupId>org.mybatis.dynamic-sql</groupId>
<artifactId>mybatis-dynamic-sql</artifactId>
<version>1.1.4</version>
</dependency>