Fórum
Dynamic Query [Help Required]
sathya prakash A, modificado 9 Anos atrás.
Dynamic Query [Help Required]
Junior Member Postagens: 67 Data de Entrada: 12/06/12 Postagens Recentes
Hi ,
I want to fetch the last seven days record from database like From Current date to SYSDATE -7 ..
How to do it by using dynamic query API.
Regards,
Sathyaprakash A
I want to fetch the last seven days record from database like From Current date to SYSDATE -7 ..
How to do it by using dynamic query API.
Regards,
Sathyaprakash A
Andew Jardine, modificado 9 Anos atrás.
RE: Dynamic Query [Help Required]
Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
Hi Sathya,
Last 7 days of which records? All of them? or something specific?
Last 7 days of which records? All of them? or something specific?
Tanweer Ahmed ., modificado 1 Ano atrás.
RE: Dynamic Query [Help Required]
Expert Postagens: 322 Data de Entrada: 11/03/10 Postagens Recentes
Hi Sathya,
Here is what I did to get the AuditEvent Records between two dates.
You can create and call your own Entity instead of AuditEvent.The lowerDate/higherDate should be of Date type.
-Tanweer
Here is what I did to get the AuditEvent Records between two dates.
final DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(AuditEvent.class, classLoader);
dynamicQuery.add(RestrictionsFactoryUtil.between("createDate", lowerDate, higherDate));
List<auditevent> auditEventList = AuditEventLocalServiceUtil.dynamicQuery(dynamicQuery);</auditevent>
You can create and call your own Entity instead of AuditEvent.The lowerDate/higherDate should be of Date type.
-Tanweer