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

Add support for count/exists queries. #214

Merged
merged 5 commits into from
Apr 18, 2014

Conversation

markuspfeiffer
Copy link

This pull request adds support for both exists and count.

// Get the number of rows that match the where-clause
final int count = new Select()
                    .from(Entity.class)
                    .where("...")
                    .count();

// Get a boolean value that indicates if any rows exist that match the where-clause
final boolean exists = new Select()
                    .from(Entity.class)
                    .where("...")
                    .exists();

@joshuapinter
Copy link
Contributor

Great addition. Can you write tests to cover these two methods?

@markuspfeiffer
Copy link
Author

Tests added.

@joshuapinter
Copy link
Contributor

Again, awesome work, @markuspfeiffer. Thanks for writing such great test coverage and updating the where methods. @SeanPONeil or @pardom should be able to merge this in.

pardom-zz pushed a commit that referenced this pull request Apr 18, 2014
Add support for count/exists queries.
@pardom-zz pardom-zz merged commit 06d0c5d into pardom-zz:master Apr 18, 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

Successfully merging this pull request may close these issues.

4 participants