@@ -31,33 +31,36 @@ import org.mybatis.dynamic.sql.util.kotlin.mybatis3.selectList
31
31
32
32
fun PersonWithAddressMapper.selectOne (completer : SelectCompleter ): PersonWithAddress ? {
33
33
val start = KotlinSelectBuilder (select(id.`as `(" A_ID" ), firstName, lastName, birthDate,
34
- employed, occupation, Address .id, Address .streetAddress, Address .city, Address .state))
35
- .from(Person )
36
- .fullJoin(Address ) {
37
- on(Person .addressId, equalTo(Address .id))
38
- }
34
+ employed, occupation, Address .id, Address .streetAddress, Address .city, Address .state)).apply {
35
+ from(Person )
36
+ fullJoin(Address ) {
37
+ on(Person .addressId, equalTo(Address .id))
38
+ }
39
+ }
39
40
40
41
return selectOne(this ::selectOne, start, completer)
41
42
}
42
43
43
44
fun PersonWithAddressMapper.select (completer : SelectCompleter ): List <PersonWithAddress > {
44
45
val start = KotlinSelectBuilder (select(id.`as `(" A_ID" ), firstName, lastName, birthDate,
45
- employed, occupation, Address .id, Address .streetAddress, Address .city, Address .state))
46
- .from(Person , " p" )
47
- .fullJoin(Address ) {
48
- on(Person .addressId, equalTo(Address .id))
49
- }
46
+ employed, occupation, Address .id, Address .streetAddress, Address .city, Address .state)).apply {
47
+ from(Person , " p" )
48
+ fullJoin(Address ) {
49
+ on(Person .addressId, equalTo(Address .id))
50
+ }
51
+ }
50
52
51
53
return selectList(this ::selectMany, start, completer)
52
54
}
53
55
54
56
fun PersonWithAddressMapper.selectDistinct (completer : SelectCompleter ): List <PersonWithAddress > {
55
57
val start = KotlinSelectBuilder (selectDistinct(id.`as `(" A_ID" ), firstName, lastName,
56
- birthDate, employed, occupation, Address .id, Address .streetAddress, Address .city, Address .state))
57
- .from(Person , " p" )
58
- .fullJoin(Address ) {
59
- on(Person .addressId, equalTo(Address .id))
60
- }
58
+ birthDate, employed, occupation, Address .id, Address .streetAddress, Address .city, Address .state)).apply {
59
+ from(Person , " p" )
60
+ fullJoin(Address ) {
61
+ on(Person .addressId, equalTo(Address .id))
62
+ }
63
+ }
61
64
62
65
return selectList(this ::selectMany, start, completer)
63
66
}
0 commit comments