You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Joe Baldwin <jf...@earthlink.net> on 2009/12/07 05:19:50 UTC
ExpressionFactory
Is it possible to build a complex expression using the ExpressionFactory that includes groupings (or is this only accomplished using the Expression.fromString() method)?
For example
(exp1 OR exp2 OR exp3) AND (exp4 OR exp5 OR exp6)
I would expect this could be accomplished using a Map (as a group), but I have found no mention of support for this in the docs I have read.
Thanks
Joe
Re: ExpressionFactory
Posted by Lachlan Deck <la...@gmail.com>.
On 07/12/2009, at 3:19 PM, Joe Baldwin wrote:
> Is it possible to build a complex expression using the ExpressionFactory that includes groupings (or is this only accomplished using the Expression.fromString() method)?
>
> For example
>
> (exp1 OR exp2 OR exp3) AND (exp4 OR exp5 OR exp6)
Yes.
Expression a = ExpressionFactory.matchExp(....).orExp( ...).orExp(....);
Expression b = ExpressionFactory.matchExp(....).orExp( ...).orExp(....);
Expression result = a.orExp(b);
> I would expect this could be accomplished using a Map (as a group), but I have found no mention of support for this in the docs I have read.
>
> Thanks
> Joe
>
with regards,
--
Lachlan Deck