Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for LEFT JOIN #426

Closed
KrYpTeD974 opened this issue Aug 30, 2016 · 1 comment
Closed

Support for LEFT JOIN #426

KrYpTeD974 opened this issue Aug 30, 2016 · 1 comment

Comments

@KrYpTeD974
Copy link

KrYpTeD974 commented Aug 30, 2016

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 )

@skrzyneckik
Copy link

#506

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants