Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0012143Openbravo ERPA. Platformpublic2010-02-04 20:542010-03-10 18:29
shuehner 
shuehner 
normalminorhave not tried
closedfixed 
5
pi 
2.50MP12 
Core
No
0012143: OBQuery class should add convenience method uniqueResult similar to the OBCriteria class
The OBCriteria class offers a uniqueResult method to fetch a single result which is easier than .list().get(0).

The OBQuery class should add the same method.
Add a typed

E uniqueResult() method, which returns a single result with the type of the query it was created with.

To support more generic untyped queries (i.e. for projections) add a second method:

Object uniqueResultObject().
No tags attached.
Issue History
2010-02-04 20:54shuehnerNew Issue
2010-02-04 20:54shuehnerAssigned To => shuehner
2010-02-04 21:07hgbotCheckin
2010-02-04 21:07hgbotNote Added: 0023975
2010-02-04 21:07hgbotStatusnew => resolved
2010-02-04 21:07hgbotResolutionopen => fixed
2010-02-04 21:07hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ff77f743663bc9a8f5c5bb523c371aa380e435e6 [^]
2010-02-10 12:59mtaalNote Added: 0024092
2010-02-10 12:59mtaalStatusresolved => closed
2010-02-10 12:59mtaalFixed in Version => 2.50MP12
2010-02-11 00:00anonymoussf_bug_id0 =>
2010-02-15 17:36hudsonbotCheckin
2010-02-15 17:36hudsonbotNote Added: 0024296
2010-03-10 18:29anonymoussf_bug_id => 2968014

Notes
(0023975)
hgbot   
2010-02-04 21:07   
Repository: erp/devel/pi
Changeset: ff77f743663bc9a8f5c5bb523c371aa380e435e6
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Thu Feb 04 21:07:09 2010 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/ff77f743663bc9a8f5c5bb523c371aa380e435e6 [^]

Fixed 12143: add uniqueResult + uniqueResultObject convenience methods
both allow to return a single result similar to the one in OBCriteria

---
M src/org/openbravo/dal/service/OBQuery.java
---
(0024092)
mtaal   
2010-02-10 12:59   
Added testcase and works fine see IssuesTest
(0024296)
hudsonbot   
2010-02-15 17:36   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/ff77f743663b [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/2596487a564c [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.16391.obx [^]