Skip to content

Chained Joins not working as documented #963

@lsh-silpion

Description

@lsh-silpion

Hi,

the documentation of chained joins given here: http://greenrobot.org/greendao/documentation/joins/ doesn't work as expected. The documentation says:

QueryBuilder<City> qb = cityDao.queryBuilder().where(Properties.Population.ge(1000000)); Join country = qb.join(Properties.CountryId, Country.class); Join continent = qb.join(country, CountryDao.Properties.ContinentId, Continent.class, ContinentDao.Properties.Id); continent.where(ContinentDao.Properties.Name.eq("Europe")); List<City> bigEuropeanCities = qb.list();

which in the case of qb.join(country, CountryDao.Properties.ContinentId, Continent.class, ContinentDao.Properties.Id); simply doesn't work because country is of type Join<T, J> but for the first parameter of this method call type Join<?, T> is required. So you could just use a new queryBuilder derived from CountryDao here, but that would not make much sense either.

Do you even test what you document? As far as I can tell from looking at your code, there is no way to make chained joins work in a way that would be useful.

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