https://kotlinlang.org logo
d

damian

01/27/2018, 9:00 PM
i'm working with DAOs. i have a table that has a foreign key /
optionalReferencedOn
, is it possible in a query to access the referenced object? (for example
User
has a reference to
City
, and
City
has a column
Inhabitants
and i want to get all users living in a
city
with at least 5k inhabitants) (typing it, it seems like it would be a better approach from "the other side" (looking for cities with inhabitants and getting all
users
that have a reference to those cities, but not sure how i'd do that either atm)
t

tapac

01/28/2018, 8:31 AM
If you can write it with DSL, then just call wrapRows other resultset.
User.wrapRows(UsersTable.select{})
2 Views