Skip to content

Commit 5a90096

Browse files
authored
Merge pull request #551 from jeffgbutler/changelog-updates
Changelog Updates
2 parents e773c05 + 1cff54c commit 5a90096

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

CHANGELOG.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,46 @@ This log will detail notable changes to MyBatis Dynamic SQL. Full details are av
44

55
## Release 1.5.0 - Unreleased
66

7-
GitHub milestone: [https://github.com/mybatis/mybatis-dynamic-sql/milestone/12](https://github.com/mybatis/mybatis-dynamic-sql/milestone/12)
7+
GitHub milestone: [https://github.com/mybatis/mybatis-dynamic-sql/milestone/12?closed=1](https://github.com/mybatis/mybatis-dynamic-sql/milestone/12?closed=1)
88

9-
Added:
9+
### "Having" Clause Support
10+
11+
This release adds support for "having" clauses in select statements. This includes a refactoring of the "where"
12+
support, so we can reuse the and/or logic and rendering that is already present in the "where" clause support.
13+
This because "having" and "where" are essentially the same.
14+
15+
One slight behavior change with this refactoring is that the renderer will now remove a useless open/close
16+
parentheses around certain rendered where clauses. Previously it was possible to have a rendered where clause like
17+
this:
18+
19+
```sql
20+
where (a < 2 and b > 3)
21+
```
22+
23+
The renderer will now remove the open/close parentheses in a case like this.
24+
25+
The "having" support is not as full-featured as the "where" support in that we don't support independent and
26+
reusable having clauses, and we don't support composable having functions. If you have a reasonable use case
27+
for that kind of support, please let us know.
28+
29+
In the Java DSL, a "having" clause can only be coded after a "group by" clause - which is a reasonable restriction
30+
as "having" is only needed if there is a "group by".
31+
32+
In the Kotlin DSL, the "group by" restriction is not present because of the free form nature of that DSL - but you
33+
should probably only use "having" if there is a "group by". Also note that the freestanding "and" and "or"
34+
functions in the Kotlin DSL still only apply to the where clause.
35+
36+
The pull request for this change is ([#550](https://github.com/mybatis/mybatis-dynamic-sql/pull/550))
37+
38+
### Other Changes
1039

1140
1. Added support for specifying "limit" and "order by" on the DELETE and UPDATE statements. Not all databases support
1241
this SQL extension, and different databases have different levels of support. For example, MySQL/MariaDB have full
1342
support but HSQLDB only supports limit as an extension to the WHERE clause. If you choose to use this new capability,
1443
please test to make sure it is supported in your database. ([#544](https://github.com/mybatis/mybatis-dynamic-sql/pull/544))
44+
2. Deprecated Kotlin DSL functions have been removed, as well as deprecated support for "EmptyListCallback" in the "in"
45+
conditions. ([#548](https://github.com/mybatis/mybatis-dynamic-sql/pull/548))
46+
1547

1648

1749
## Release 1.4.1 - October 7, 2022

0 commit comments

Comments
 (0)