@@ -28,6 +28,7 @@ import org.junit.jupiter.api.Test
28
28
import org.mybatis.dynamic.sql.exception.InvalidSqlException
29
29
import org.mybatis.dynamic.sql.util.Messages
30
30
import org.mybatis.dynamic.sql.util.kotlin.KInvalidSQLException
31
+ import org.mybatis.dynamic.sql.util.kotlin.elements.`as`
31
32
import org.mybatis.dynamic.sql.util.kotlin.elements.case
32
33
import org.mybatis.dynamic.sql.util.kotlin.elements.cast
33
34
import org.mybatis.dynamic.sql.util.kotlin.elements.isEqualTo
@@ -63,7 +64,7 @@ class KCaseExpressionTest {
63
64
then(" Bat" )
64
65
}
65
66
`else `(" Not a Fox or a bat" )
66
- }. `as `( " AnimalType" )
67
+ } `as ` " AnimalType"
67
68
) {
68
69
from(animalData, " a" )
69
70
where { id.isIn(2 , 3 , 31 , 32 , 38 , 39 ) }
@@ -140,7 +141,7 @@ class KCaseExpressionTest {
140
141
then(2 )
141
142
}
142
143
`else `(3 )
143
- }. `as `( " AnimalType" )
144
+ } `as ` " AnimalType"
144
145
) {
145
146
from(animalData, " a" )
146
147
where { id.isIn(2 , 3 , 31 , 32 , 38 , 39 ) }
@@ -217,7 +218,7 @@ class KCaseExpressionTest {
217
218
then(value(" Bat" ))
218
219
}
219
220
`else `(cast { value(" Not a Fox or a bat" ) `as ` " VARCHAR(30)" })
220
- }. `as `( " AnimalType" )
221
+ } `as ` " AnimalType"
221
222
) {
222
223
from(animalData, " a" )
223
224
where { id.isIn(2 , 3 , 31 , 32 , 38 , 39 ) }
@@ -297,7 +298,7 @@ class KCaseExpressionTest {
297
298
or { animalName isEqualTo " Big brown bat" }
298
299
then(" Bat" )
299
300
}
300
- }. `as `( " AnimalType" )
301
+ } `as ` " AnimalType"
301
302
) {
302
303
from(animalData, " a" )
303
304
where { id.isIn(2 , 3 , 31 , 32 , 38 , 39 ) }
@@ -379,7 +380,7 @@ class KCaseExpressionTest {
379
380
then(" Fred" )
380
381
}
381
382
`else `(" Not a Fox or a bat" )
382
- }. `as `( " AnimalType" )
383
+ } `as ` " AnimalType"
383
384
) {
384
385
from(animalData, " a" )
385
386
where { id.isIn(2 , 3 , 4 , 31 , 32 , 38 , 39 ) }
@@ -458,7 +459,7 @@ class KCaseExpressionTest {
458
459
case(animalName) {
459
460
`when ` (isEqualTo(" Artic fox" ), isEqualTo(" Red fox" )) { then(" yes" ) }
460
461
`else `(" no" )
461
- }. `as `( " IsAFox" )
462
+ } `as ` " IsAFox"
462
463
) {
463
464
from(animalData)
464
465
where { id.isIn(31 , 32 , 38 , 39 ) }
@@ -512,7 +513,7 @@ class KCaseExpressionTest {
512
513
case(animalName) {
513
514
`when ` (" Artic fox" , " Red fox" ) { then(" yes" ) }
514
515
`else `(" no" )
515
- }. `as `( " IsAFox" )
516
+ } `as ` " IsAFox"
516
517
) {
517
518
from(animalData)
518
519
where { id.isIn(31 , 32 , 38 , 39 ) }
@@ -566,7 +567,7 @@ class KCaseExpressionTest {
566
567
case(animalName) {
567
568
`when ` (isEqualTo(" Artic fox" ), isEqualTo(" Red fox" )) { then(true ) }
568
569
`else `(false )
569
- }. `as `( " IsAFox" )
570
+ } `as ` " IsAFox"
570
571
) {
571
572
from(animalData)
572
573
where { id.isIn(31 , 32 , 38 , 39 ) }
@@ -620,7 +621,7 @@ class KCaseExpressionTest {
620
621
case(animalName) {
621
622
`when ` (" Artic fox" , " Red fox" ) { then(true ) }
622
623
`else `(false )
623
- }. `as `( " IsAFox" )
624
+ } `as ` " IsAFox"
624
625
) {
625
626
from(animalData)
626
627
where { id.isIn(31 , 32 , 38 , 39 ) }
@@ -673,7 +674,7 @@ class KCaseExpressionTest {
673
674
animalName,
674
675
case(animalName) {
675
676
`when `(isEqualTo(" Artic fox" ), isEqualTo(" Red fox" )) { then(" yes" ) }
676
- }. `as `( " IsAFox" )
677
+ } `as ` " IsAFox"
677
678
) {
678
679
from(animalData)
679
680
where { id.isIn(31 , 32 , 38 , 39 ) }
@@ -721,7 +722,7 @@ class KCaseExpressionTest {
721
722
case(animalName) {
722
723
`when `(isEqualTo(" Artic fox" ), isEqualTo(" Red fox" )) { then(cast { " It's a fox" `as ` " VARCHAR(30)" })}
723
724
`else `(" It's not a fox" )
724
- }. `as `( " IsAFox" )
725
+ } `as ` " IsAFox"
725
726
) {
726
727
from(animalData)
727
728
where { id.isIn(31 , 32 , 38 , 39 ) }
@@ -764,7 +765,7 @@ class KCaseExpressionTest {
764
765
case(animalName) {
765
766
`when `(isEqualTo(" Artic fox" ), isEqualTo(" Red fox" )) { then( 1L ) }
766
767
`else `(2L )
767
- }. `as `( " IsAFox" )
768
+ } `as ` " IsAFox"
768
769
) {
769
770
from(animalData)
770
771
where { id.isIn(31 , 32 , 38 , 39 ) }
@@ -807,7 +808,7 @@ class KCaseExpressionTest {
807
808
case(animalName) {
808
809
`when `(isEqualTo(" Artic fox" ), isEqualTo(" Red fox" )) { then( 1.1 ) }
809
810
`else `(2.2 )
810
- }. `as `( " IsAFox" )
811
+ } `as ` " IsAFox"
811
812
) {
812
813
from(animalData)
813
814
where { id.isIn(31 , 32 , 38 , 39 ) }
@@ -850,7 +851,7 @@ class KCaseExpressionTest {
850
851
case(animalName) {
851
852
`when `(isEqualTo(" Artic fox" ), isEqualTo(" Red fox" )) { then( 1.1 ) }
852
853
`else `(cast { 2.2 `as ` " DOUBLE" })
853
- }. `as `( " IsAFox" )
854
+ } `as ` " IsAFox"
854
855
) {
855
856
from(animalData)
856
857
where { id.isIn(31 , 32 , 38 , 39 ) }
0 commit comments