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

Problem with using 'whereOr' and 'and' in same select query #104

Closed
vaneyck opened this issue Jun 18, 2014 · 1 comment
Closed

Problem with using 'whereOr' and 'and' in same select query #104

vaneyck opened this issue Jun 18, 2014 · 1 comment
Assignees

Comments

@vaneyck
Copy link

vaneyck commented Jun 18, 2014

It seems that sugar orm doesn't nest OR operations properly. For example, in this code the and operation interferes with the whereOr

    Select.from(Message.class)
        .whereOr(Condition.prop("delivery_status").eq(DeliveryStatus.SENT),
        Condition.prop("delivery_status").eq(DeliveryStatus.FAILED))
        .and(Condition.prop("synced").eq(0))
        .list();

The result query would be

    delivery_status == SENT || ( delivery_status == FAILED && synced == 0)
@vaneyck vaneyck changed the title Problem with using 'whereOr' and 'and' Problem with using 'whereOr' and 'and' in same select query Jun 18, 2014
@whoshuu
Copy link
Collaborator

whoshuu commented Jul 4, 2014

Interesting find. Will take a closer look at this behavior within the next week.

@whoshuu whoshuu self-assigned this Jul 4, 2014
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

2 participants