Skip to content

Commit 07cb132

Browse files
committed
Update docs with new syntax
1 parent 95713da commit 07cb132

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22

33
This log will detail notable changes to MyBatis Dynamic SQL. Full details are available on the GitHub milestone pages.
44

5-
## Release 1.5.1 - April 30, 2024
5+
## Release 1.5.2 - Unreleased
66

7-
This is a minor release with several enhancements.
7+
This is a small maintenance release with improvements to the Kotlin DSL for CASE expressions.
88

99
**Important:** This is the last release that will be compatible with Java 8.
1010

11+
## Release 1.5.1 - April 30, 2024
12+
13+
This is a minor release with several enhancements.
14+
1115
GitHub milestone: [https://github.com/mybatis/mybatis-dynamic-sql/milestone/13?closed=1](https://github.com/mybatis/mybatis-dynamic-sql/milestone/13?closed=1)
1216

1317
### Case Expressions and Cast Function

src/site/markdown/docs/kotlinCaseExpressions.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ A simple case expression can be coded like the following in the Kotlin DSL:
7272

7373
```kotlin
7474
select(case(id) {
75-
`when`(1, 2, 3) { then(true) }
75+
`when`(1, 2, 3) then true
7676
`else`(false)
7777
} `as` "small_id"
7878
) {
@@ -91,7 +91,7 @@ you can write the query as follows:
9191

9292
```kotlin
9393
select(case(id) {
94-
`when`(1, 2, 3) { then(value(true)) }
94+
`when`(1, 2, 3) then value(true)
9595
`else`(value(false))
9696
} `as` "small_id"
9797
) {
@@ -111,7 +111,7 @@ expected data type. Here's an example of using the `cast` function:
111111

112112
```kotlin
113113
select(case(id) {
114-
`when`(1, 2, 3) { then(value(true)) }
114+
`when`(1, 2, 3) then value(true)
115115
`else`(cast { value(false) `as` "BOOLEAN" })
116116
} `as` "small_id"
117117
) {
@@ -134,8 +134,8 @@ A simple case expression can be coded like the following in the Kotlin DSL:
134134

135135
```kotlin
136136
select(case(total_length) {
137-
`when`(isLessThan(10)) { then("small") }
138-
`when`(isGreaterThan(20)) { then("large") }
137+
`when`(isLessThan(10)) then "small"
138+
`when`(isGreaterThan(20)) then "large"
139139
`else`("medium")
140140
} `as` "tshirt_size"
141141
) {
@@ -158,8 +158,8 @@ VARCHAR, you can use the `cast` function as follows:
158158

159159
```kotlin
160160
select(case(total_length) {
161-
`when`(isLessThan(10)) { then("small") }
162-
`when`(isGreaterThan(20)) { then("large") }
161+
`when`(isLessThan(10)) then "small"
162+
`when`(isGreaterThan(20)) then "large"
163163
`else`(cast { "medium" `as` "VARCHAR(6)" })
164164
} `as` "tshirt_size"
165165
) {

0 commit comments

Comments
 (0)