Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
gary b
Dynamic Query
16 de Fevereiro de 2013 06:00
Resposta

gary b

Ranking: Junior Member

Mensagens: 77

Data de entrada: 2 de Fevereiro de 2013

Mensagens recentes

Hi,

I am using dynamic query in my custom announcement portlet. I need to compare journalarticle "displayDate" with current date .
For equal to I can use below syntax and to implement both equal to and less that I need to use Criterion But i don't know the exact syntax for that.

dynamicQuery.add(PropertyFactoryUtil.forName("displayDate").eq(CurrentDate));

I want to know how can we use less than clause using dynamic query.
Kowbathullah Gnaniyar
RE: Dynamic Query
16 de Fevereiro de 2013 06:12
Resposta

Kowbathullah Gnaniyar

Ranking: Liferay Master

Mensagens: 608

Data de entrada: 19 de Dezembro de 2007

Mensagens recentes

PropertyFactoryUtil.forName("field").lt(5);
gary b
RE: Dynamic Query
16 de Fevereiro de 2013 07:12
Resposta

gary b

Ranking: Junior Member

Mensagens: 77

Data de entrada: 2 de Fevereiro de 2013

Mensagens recentes

Thanks for the reply... :-)

Is there any thing for less that equal to?
Chirag Patadia
RE: Dynamic Query
16 de Fevereiro de 2013 23:49
Resposta

Chirag Patadia

Ranking: Junior Member

Mensagens: 29

Data de entrada: 2 de Fevereiro de 2012

Mensagens recentes

For less than equal to you can use le(object) method.

PropertyFactoryUtil.forName("<<property name>>").le(object);
gary b
RE: Dynamic Query
17 de Fevereiro de 2013 22:40
Resposta

gary b

Ranking: Junior Member

Mensagens: 77

Data de entrada: 2 de Fevereiro de 2013

Mensagens recentes

thanks a lot.. emoticon
actually this is first I am using dynamic query so I am not aware of this.