File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -22,12 +22,12 @@ For example, a typical search can be coded with a query like this (the following
2222 fun search (id : String? , firstName : String? , lastName : String? ) =
2323 select(Customer .id, Customer .firstName, Customer .lastName) {
2424 from(Customer )
25- where( Customer .active, isEqualTo( true ))
26- and ( Customer .id, isEqualToWhenPresent(id).map{ it?.padStart(5 , ' 0' ) })
27- and ( Customer .firstName, isLikeCaseInsensitiveWhenPresent(firstName)
28- .map{ " %" + it.trim() + " %" })
29- and ( Customer .lastName, isLikeCaseInsensitiveWhenPresent(lastName)
30- .map{ " %" + it.trim() + " %" })
25+ where { Customer .active.isTrue() }
26+ and { Customer .id ( isEqualToWhenPresent(id).map{ it?.padStart(5 , ' 0' ) }) }
27+ and { Customer .firstName ( isLikeCaseInsensitiveWhenPresent(firstName)
28+ .map{ " %" + it.trim() + " %" }) }
29+ and { Customer .lastName ( isLikeCaseInsensitiveWhenPresent(lastName)
30+ .map{ " %" + it.trim() + " %" }) }
3131 orderBy(Customer .lastName, Customer .firstName)
3232 limit(500 )
3333 }
You can’t perform that action at this time.
0 commit comments