File tree Expand file tree Collapse file tree 3 files changed +3
-15
lines changed
main/java/org/mybatis/dynamic/sql
test/kotlin/examples/kotlin/spring/canonical Expand file tree Collapse file tree 3 files changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ private SelectModel buildModel() {
70
70
.withTable (table ())
71
71
.withTableAliases (tableAliases ());
72
72
73
- if (whereBuilder != null ){
73
+ if (whereBuilder != null ) {
74
74
b .withWhereModel (whereBuilder .buildWhereModel ());
75
75
}
76
76
Original file line number Diff line number Diff line change @@ -52,9 +52,9 @@ public Optional<WhereClauseProvider> render() {
52
52
53
53
if (whereClause .isPresent () || whereModel .isUnrenderableClauseAllowed ()) {
54
54
return whereClause ;
55
+ } else {
56
+ throw new UnrenderableWhereClauseException ();
55
57
}
56
-
57
- throw new UnrenderableWhereClauseException ();
58
58
}
59
59
60
60
private Optional <RenderedCriterion > renderWithInitialCriterion (SqlCriterion initialCriterion ) {
Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ import examples.kotlin.spring.canonical.PersonDynamicSqlSupport.lastName
24
24
import org.assertj.core.api.Assertions.assertThat
25
25
import org.assertj.core.api.Assertions.assertThatExceptionOfType
26
26
import org.junit.jupiter.api.Test
27
- import org.mybatis.dynamic.sql.exception.UnrenderableWhereClauseException
28
27
import org.mybatis.dynamic.sql.util.kotlin.KInvalidSQLException
29
28
import org.mybatis.dynamic.sql.util.kotlin.elements.isLike
30
29
import org.mybatis.dynamic.sql.util.kotlin.elements.stringConstant
@@ -96,17 +95,6 @@ open class InfixElementsTest {
96
95
assertThat(rows[0 ]).isEqualTo(" Bamm Bamm" )
97
96
}
98
97
99
- @Test
100
- fun testVanishingWhereClause () {
101
- assertThatExceptionOfType(UnrenderableWhereClauseException ::class .java).isThrownBy {
102
- select(firstName) {
103
- from(person)
104
- where { id isEqualToWhenPresent null }
105
- orderBy(id)
106
- }
107
- }
108
- }
109
-
110
98
@Test
111
99
fun testIsEqualToWhenPresentNull () {
112
100
val selectStatement = select(firstName) {
You can’t perform that action at this time.
0 commit comments