[seam-issues] [JBoss JIRA] Closed: (SOLDER-41) add getSingleResult() to PropertyQuery

Dan Allen (JIRA) jira-events at lists.jboss.org
Fri Dec 17 23:13:18 EST 2010


     [ https://issues.jboss.org/browse/SOLDER-41?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Allen closed SOLDER-41.
---------------------------



Updating fix version.

> add getSingleResult() to PropertyQuery
> --------------------------------------
>
>                 Key: SOLDER-41
>                 URL: https://issues.jboss.org/browse/SOLDER-41
>             Project: Seam Solder
>          Issue Type: Feature Request
>            Reporter: Dan Allen
>            Assignee: Dan Allen
>             Fix For: 3.0.0.Beta1
>
>
> PropertyQuery should offer the method getSingleResult() for the same reason it exists in the JPA Query interface: to fetch a single result but also assert that there is only one result to be fetched. If more than one property is matched when getSingleResult() is called, an exception will result. 
> Using getFirstResult() to return exactly one result is inappropriate (and could lead to bugs) because it could hide the fact that multiple properties are being inadvertently matched. As a workaround, the developer would currently have to run getResultList() to ensure only one property matches. Offering a getSingleResult() would resolve these issues.
> See http://download.oracle.com/javaee/6/api/javax/persistence/Query.html#getSingleResult()

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the seam-issues mailing list