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

setParameter(...) on CountQuery not chainable #563

Closed
Backfighter opened this issue Jan 21, 2017 · 1 comment
Closed

setParameter(...) on CountQuery not chainable #563

Backfighter opened this issue Jan 21, 2017 · 1 comment
Assignees
Milestone

Comments

@Backfighter
Copy link

The setParameter(...) method which CountQuery gains from the derivation of AbstractQuery can't be used with a CountQuery for the following reason. The AbstractQuery class is not visible to the API user. Since the user can't see the AbstractQuery class returned by a call to setParameter(...) he can't call its methods.
Is this indented or not?

@greenrobot-team
Copy link
Collaborator

Hm, looks like chaining is not supported, yes. As a workaround you can assign the query object to a variable like:

CountQuery<Note> noteCountQuery =  noteDao.queryBuilder().buildCount();
noteCountQuery.setParameter(0, true);
long count = noteCountQuery.count();

Uwe

@greenrobot-team greenrobot-team changed the title setParameter(...) on CountQuery unuseable setParameter(...) on CountQuery not chainable Jan 23, 2017
greenrobot-team added a commit to greenrobot-team/greenDAO that referenced this issue Apr 3, 2017
@greenrobot-team greenrobot-team self-assigned this Apr 3, 2017
greenrobot-team added a commit to greenrobot-team/greenDAO that referenced this issue Apr 3, 2017
- Closes greenrobot#563
- Move setParameter for Date and Boolean up to AbstractQuery.
- Copy setParameter methods to all query classes, cast return value to specific query class.
@greenrobot greenrobot added this to the 3.2.2 milestone Apr 3, 2017
diamondyhand added a commit to diamondyhand/green-DAO that referenced this issue Dec 15, 2023
- Closes greenrobot/greenDAO#563
- Move setParameter for Date and Boolean up to AbstractQuery.
- Copy setParameter methods to all query classes, cast return value to specific query class.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants