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

CassQuery.getSingleResult returns empty list when item not found #509

Closed
bramp opened this issue Jan 22, 2014 · 3 comments
Closed

CassQuery.getSingleResult returns empty list when item not found #509

bramp opened this issue Jan 22, 2014 · 3 comments
Assignees
Milestone

Comments

@bramp
Copy link

bramp commented Jan 22, 2014

From what I understand about the JPA, getSingleResult is meant to throw an NoSuchElementException if there is no single result. Instead it returns an empty list. Additionally it should throw NonUniqueResultException if more than one element is found. It throws neither.

    @Override
    public Object getSingleResult()
    {
        // to fetch a single result form database.
        isSingleResult = true;
        List results = getResultList();
        isSingleResult = false;
        return results.isEmpty() ? results : results.get(0);
    }
mevivs added a commit that referenced this issue Jan 22, 2014
@ghost ghost assigned mevivs Jan 22, 2014
@mevivs
Copy link
Collaborator

mevivs commented Jan 22, 2014

Fix added on current trunk and releasing with 2.10

-Vivek

@bramp
Copy link
Author

bramp commented Jan 22, 2014

Awesome thanks.
On Jan 22, 2014 2:36 AM, "Vivek Mishra" notifications@github.com wrote:

Fix added on current trunk and releasing with 2.10

-Vivek


Reply to this email directly or view it on GitHubhttps://github.com//issues/509#issuecomment-33010012
.

mevivs added a commit that referenced this issue Jan 23, 2014
@mevivs
Copy link
Collaborator

mevivs commented Jan 31, 2014

Fixed and releasing with 2.10

-Vivek

@mevivs mevivs closed this as completed Jan 31, 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