Fórum
Dynamic Query
garima bhandari, modificado 11 Anos atrás.
Dynamic Query
Junior Member Postagens: 81 Data de Entrada: 02/02/13 Postagens 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.
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.
Gnaniyar Zubair, modificado 11 Anos atrás.
RE: Dynamic Query
Liferay Master Postagens: 722 Data de Entrada: 19/12/07 Postagens RecentesPropertyFactoryUtil.forName("field").lt(5);
garima bhandari, modificado 11 Anos atrás.
RE: Dynamic Query
Junior Member Postagens: 81 Data de Entrada: 02/02/13 Postagens Recentes
Thanks for the reply... :-)
Is there any thing for less that equal to?
Is there any thing for less that equal to?
Chirag Patadia, modificado 11 Anos atrás.
RE: Dynamic Query
Junior Member Postagens: 29 Data de Entrada: 03/02/12 Postagens Recentes
For less than equal to you can use le(object) method.
PropertyFactoryUtil.forName("<<property name>>").le(object);
PropertyFactoryUtil.forName("<<property name>>").le(object);
garima bhandari, modificado 11 Anos atrás.
RE: Dynamic Query
Junior Member Postagens: 81 Data de Entrada: 02/02/13 Postagens Recentes
thanks a lot..
actually this is first I am using dynamic query so I am not aware of this.
actually this is first I am using dynamic query so I am not aware of this.