John McNally wrote:
> 
> I think a simple solution can be implemented.  With the proposals
> currently in the works I do not see a reason to completely redesign
> Criteria.  How about a flag to note which method was called first then
> that condition will be given the higher priority?  I think that would be
> fairly intuitive, though I have not used the new convenience methods and
> do not know if it is as workable/intuitive as I imagine.

In my last post (perhaps you posted more ore less at the same time)
I mentioned that I thought of such a flag, too. But, this only holds
for expressions with a depth of two, like the discussed example,
or perhaps for some special expressions of greater depths, if you
exactly know how to construct them - but never generally.
Imagine that:

   ((a<1 or b<2) and (c<3 or d<4)) or ((a>5 or b>6) and (c>7 or d>8))

With a1.or(b2).and(c3.or(d4)) you get it right, as the and-chain
(containing c3-(and)-c4) is marked as binding less than the or-chain
(b2).
As soon as you again call or(), the new thing is appended to the back
of the or-chain and you again would have to change the flag to mark the
or-chain to bind less. The result:

   ((a<1 and (c<3 or d<4)) or (b2 or ((a>5 or b>6) and (c>7 or d>8)))

I hope, reading Erics and my former posts again, we can convince you
there is a conceptual problem achieving general where-expressions with
the given criterion-linkage concept.

And still I hope after further examination you both come to the
decision that my diff can be added without risk but only benefits.

The above example:

Criteria.Connector
con1=crit.getNewConnector(a1.or(b2),c3.or(d4),Criteria.CTYPE_AND);
Criteria.Connector
con2=crit.getNewConnector(a5.or(b6),c7.or(d8),Criteria.CTYPE_AND);
crit.add(crit.getNewConnector(con1,con2,Criteria.CONN_TYPE_OR));

-- 
Florian Lindauer
_________________________________________
SecureNet GmbH * http://www.secure-net.de
Phone +49 89/32133-662 * [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to