-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Description
It seems sometimes a LEFT JOIN would be useful.
Consider this case:
with Company 1 - N Person
If you want to display a list of persons with their names and their company's name. But not every person has a company.
In order to avoid that every call to person.getCompany() results to a new SQL query, a left join would be useful.
The following query results to an INNER JOIN and so you don't get the persons without a company.
QueryBuilder<Person> queryBuilder = session.getPersonDao().queryBuilder();
queryBuilder.join(PersonDao.Properties.CompanyId, Company.class);
queryBuilder.list()
I'm thinking about something like querybuilder.leftjoin(...).
from( http://stackoverflow.com/questions/39034291/greendao-left-join )
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels