Skip to content

Support for LEFT JOIN #426

@KrYpTeD974

Description

@KrYpTeD974

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 )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions