Last active
December 20, 2015 16:49
-
-
Save cheptsov/6164062 to your computer and use it in GitHub Desktop.
Type-safe inner join via Exposed library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Users.name + Users.cityId * Cities.name).filter { Users.id.equals("andrey") } forEach { | |
val (userName, cityName) = it | |
println("$userName lives in $cityName") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Generates:
SELECT Users.name, Cities.name FROM Users INNER JOIN Cities ON Cities.id = Users.city_id WHERE Users.id = 'andrey'