Search code examples
liferay-6

Liferay Service Builder - FinderImpl between date


using the Liferay 6.0.6 ServiceBuilder i am trying to implement a finder method.
I want the method to return all objects whose create date is in between a given date range.

I have learned that hibernate offers the criteria Expression.between("date", dateFrom, dateTo).

Howerver com.liferay.portal.kernel.dao.orm.SQLQuery which i use does not offer a criteria like this.

Maybe i have missed something in the service.xml already but the only thing i found here was <finder-column name="createDate" comparator=""/> which is in my opinion not helpfull.

Is there a different way to implement this finder method as i want to / change the service.xml?

Thanks for your suggestions


Solution

  • further investigations brought me to
    RestrictionsFactoryUtil.between("deleteDate", dateFrom, dateTo); DynamicQueryFactoryUtil.forClass(Test.class).add(criterion)
    So there is a working criterion ;)