You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Hans Novak <hn...@repcom.de> on 2007/09/25 15:44:18 UTC
TO: Alessandro Colantoni: Problems with "LogicSqlCondition"
Hi Allesandro,
i have a question to the "LogicSqlCondition"
When i ask mandragora with
Partner.class, new LogicSqlCondition("NAME","leftlike","r")
i get not the object, whats beginnig with r, but one, who have an "r"
somewhere in the name (and only 1 object, but there are more with "r" in
the name).
When i call it
Partner.class, new LogicSqlCondition("NAME","leftlike","r*")
i get all object beginning with "r" and containig a "r" in the "NAME" Field.
What i doing wrong ?
Hans
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: TO: Alessandro Colantoni: Problems with "LogicSqlCondition"
Posted by Hans Novak <hn...@repcom.de>.
Ok, this helps.
thx
Hans
Alessandro Colantoni schrieb:
> Hi Hans
> I think that in an other post I got mistake.
>
> If you want all beginning with r you have to put RIGHTLIKE.
> when you use RIGHTLIKE just updated a criteria in this way
>
>
> criteria.addLike(field,value+"%");
>
> with leftLike
>
> criteria.addLike(field,"%"+value);
>
> I hope this help
> Regards
> Alessandro
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: TO: Alessandro Colantoni: Problems with "LogicSqlCondition"
Posted by Alessandro Colantoni <al...@gmail.com>.
Hi Hans
I think that in an other post I got mistake.
If you want all beginning with r you have to put RIGHTLIKE.
when you use RIGHTLIKE just updated a criteria in this way
criteria.addLike(field,value+"%");
with leftLike
criteria.addLike(field,"%"+value);
I hope this help
Regards
Alessandro
On 9/25/07, Hans Novak <hn...@repcom.de> wrote:
>
> Hi Allesandro,
>
> i have a question to the "LogicSqlCondition"
>
> When i ask mandragora with
>
> Partner.class, new LogicSqlCondition("NAME","leftlike","r")
>
> i get not the object, whats beginnig with r, but one, who have an "r"
> somewhere in the name (and only 1 object, but there are more with "r" in
> the name).
>
> When i call it
>
> Partner.class, new LogicSqlCondition("NAME","leftlike","r*")
>
> i get all object beginning with "r" and containig a "r" in the "NAME"
> Field.
>
> What i doing wrong ?
>
>
> Hans
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>