You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Øyvind Harboe <oy...@zylin.com> on 2006/08/15 21:49:52 UTC

TRUE & FALSE Expression

Is there a way to create an expression that is TRUE or FALSE?

ExpressionFactory.expTrue/False() -> always true/false.

This would be useful when writing functions that e.g. return an
Expression whether some part or the  complete list of records should
be returned.

-- 
Øyvind Harboe
http://www.zylin.com

Re: TRUE & FALSE Expression

Posted by Andrus Adamchik <an...@objectstyle.org>.
new ASTScalar(Boolean.TRUE) should do the trick.

Andrus


On Aug 15, 2006, at 3:57 PM, Øyvind Harboe wrote:

> On 8/15/06, Mike Kienenberger <mk...@gmail.com> wrote:
>> I don't understand what you're asking.
>>
>> Can you give a concrete and specific example?
>
> Here I start off with TRUE and then reduce the matching set using  
> andExp().
>
> Expression e=ExpressionFactory.expTrue();
>
> if (xxx)
> {
>  e=e.andExp(....);
> }
>
> if (yyy)
> {
>  e=e.andExp(....);
> }
>
>
> return e;
>
>
> -- 
> Øyvind Harboe
> http://www.zylin.com
>


Re: TRUE & FALSE Expression

Posted by Øyvind Harboe <oy...@zylin.com>.
On 8/15/06, Mike Kienenberger <mk...@gmail.com> wrote:
> I don't understand what you're asking.
>
> Can you give a concrete and specific example?

Here I start off with TRUE and then reduce the matching set using andExp().

Expression e=ExpressionFactory.expTrue();

if (xxx)
{
  e=e.andExp(....);
}

if (yyy)
{
  e=e.andExp(....);
}


return e;


-- 
Øyvind Harboe
http://www.zylin.com

Re: TRUE & FALSE Expression

Posted by Mike Kienenberger <mk...@gmail.com>.
I don't understand what you're asking.

Can you give a concrete and specific example?


On 8/15/06, Øyvind Harboe <oy...@zylin.com> wrote:
> Is there a way to create an expression that is TRUE or FALSE?
>
> ExpressionFactory.expTrue/False() -> always true/false.
>
> This would be useful when writing functions that e.g. return an
> Expression whether some part or the  complete list of records should
> be returned.
>
> --
> Øyvind Harboe
> http://www.zylin.com
>