Skip to content

Commit 269b189

Browse files
committed
Update CHANGELOG.md
1 parent d023ee8 commit 269b189

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

CHANGELOG.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The major themes of this release include the following:
1414
1. Add support for the "exists" and "not exists" operator. This will work in "where" clauses anywhere
1515
they are supported.
1616
1. Refactor and improve the built-in conditions for consistency (see below)
17-
1. Continue to refine the Kotlin DSL. Most changes to the Kotlin DSL are internal and should be source code
17+
1. Continue to refine the Kotlin DSL. Many changes to the Kotlin DSL are internal and should be source code
1818
compatible with existing code. There is one breaking change detailed below.
1919
1. Remove deprecated code from prior releases.
2020

@@ -31,7 +31,8 @@ However, there are some changes in behavior and one breaking change.
3131
for a similar purpose.
3232
1. The new "filter" method works a bit differently than the "when" method it replaces. The old "when" method could not
3333
be chained - if it was called multiple times, only the last call would take effect. The new "filter" methods works
34-
as it should and every call will take effect.
34+
as it should and every call will take effect. This allows you to construct map/filter pipelines as you would
35+
expect.
3536
1. The new "map" method will allow you to change the datatype of a condition as is normal for a "map" method. You
3637
can use this method to apply a type conversion directly within condition.
3738
1. All the "WhenPresent" conditions have been removed as separate classes. The methods that produced these conditions
@@ -62,9 +63,26 @@ However, there are some changes in behavior and one breaking change.
6263
```
6364
We think this is a marked improvement!
6465

65-
### Breaking Change for Kotlin
66+
### Kotlin DSL Update and Breaking Change for Kotlin
6667

67-
In this release the Kotlin support for `select` and `count` statements has been refactored. This will not impact code
68+
The Kotlin DSL continues to evolve. With this release we have fully built out the DSL, and it is no longer necessary
69+
to use any functions in `org.mybatis.dynamic.sql.SqlBuilder`. The advantages of this are many and are detailed on the
70+
Kotlin overview page in the documentation. Many functions in `SqlBuilder` have been replaced by
71+
top level functions the `org.mybatis.dynamic.sql.util.kotlin.elements` package. In most cases you can switch to the
72+
native Kotlin DSL by simply changing the import statements. For example, you can switch usage of the `isEqualTo`
73+
function by changing
74+
75+
```kotlin
76+
import org.mybatis.dynamic.sql.SqlBuilder.isEqualTo
77+
```
78+
79+
to
80+
81+
```kotlin
82+
import org.mybatis.dynamic.sql.util.kotlin.elements.isEqualTo
83+
```
84+
85+
A breaking change is that Kotlin support for `select` and `count` statements has been refactored. This will not impact code
6886
created by MyBatis generator. It will have an impact on Spring/Kotlin users as well as MyBatis users that coded joins or
6987
other queries directly in Kotlin. The difference is that the `from` clause has been moved inside the lambda for select
7088
and count statements.

0 commit comments

Comments
 (0)