I started using queries last week and also found the null for empty results less than intuitive. An exception on no query existing would also be better from my point of view.
 
Steve

 
On 11/8/06, Edson Tirelli <[EMAIL PROTECTED]> wrote:

  Geoffrey,

  I certainly agree with you on returning an empty list in case there
are no results.
  About throwing an exception in case the query does not exist, I also
agree, but I would like to hear from others if anyone has any problem
with that.

  So, I will open a ticket and change both behaviors in case no one
manifest against it.

  []s
  Edson


Geoffrey De Smet wrote:

> Thanks Edson for fixing the getQueryResults() method in JBRULES-539.
> I found something interesting I'd like to bring under discussion:
>
> WorkingMemory.getQueryResults() returns null when:
>
> - no such query exists in the drl's. I would have expected an
> IllegalArgumentException, in the spirit of fail-fast,
> but it's not that big a deal.
>
> - but it also returns null when the query has 0 results.
> I would have expected a QueryResults instance with .size() == 0.
> It seems inconsistent with WorkingMemory.getObjects(X.class) which
> does return an empty list, instead of null.
>
> [tested on the branch for 3.0.x for Rete]
>
> What do you think?
>


--
---
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3124-6000
Mobile: +55 11 9218-4151
JBoss, a division of Red Hat @ www.jboss.com

IT executives: Red Hat still #1 for value
http://www.redhat.com/promo/vendor/


---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email




--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference

Reply via email to