cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrey Razumovsky" <razumovsky.and...@gmail.com>
Subject Re: How to?
Date Fri, 16 Jan 2009 16:23:48 GMT
Expressions are immutable, so "qualifier4.orExp(qualifier3)" does nothing.
You need to do something like qualifier4 = qualifier4.orExp(qualifier3);

2009/1/16 Sid Ferreira <sid.gbf@gmail.com>

> Ok, worked and fixed, but not 100%... Now Im using:
>
> qualifier1 = ExpressionFactory.matchDbExp("cd_cliente", 10);
> qualifier2 =
> ExpressionFactory.likeIgnoreCaseExp(UsuariosClientes.NM_PESSOA_PROPERTY,
> "%"+dsQuery+"%");
> qualifier3 =
> ExpressionFactory.likeIgnoreCaseExp(UsuariosClientes.DS_CARGO_PROPERTY,
> "%"+dsQuery+"%");
> qualifier4 =
>
> ExpressionFactory.likeIgnoreCaseExp(UsuariosClientes.DS_DEPARTAMENTO_PROPERTY,
> "%"+dsQuery+"%");
> qualifier4.orExp(qualifier3);
> qualifier3.orExp(qualifier2);
> qualifier1.andExp(qualifier2);
> select1 = new SelectQuery(UsuariosClientes.class);
> select1.orQualifier(qualifier2);
>
> But the SQL:
> SELECT *
>
> FROM public.usuarios_clientes t0
> WHERE t0.nm_pessoa ILIKE ?
>
> What is wrong? Seem that it takes only one of the parameters...
>
> On Fri, Jan 16, 2009 at 11:52 AM, Sid Ferreira <sid.gbf@gmail.com> wrote:
>
> > Cache... seem that I wasn't refreshing properly my application...Anyway,
> > trying again the pk field...
> >
> >
> > On Fri, Jan 16, 2009 at 11:38 AM, Andrus Adamchik <
> andrus@objectstyle.org>wrote:
> >
> >>
> >> On Jan 16, 2009, at 3:35 PM, Sid Ferreira wrote:
> >>
> >>  a long
> >>>
> >>
> >> And what SQL did it generate? Was there an exception?
> >>
> >> Andrus
> >>
> >
> >
> >
> > --
> > Sidney G B Ferreira
> > Desenvolvedor Web - Tibox Innovations
> >
> >
>
>
> --
> Sidney G B Ferreira
> Desenvolvedor Web - Tibox Innovations
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message