留言板

java.lang.UnsupportedOperationException: query result offset is not support

Kieu Phong,修改在11 年前。

java.lang.UnsupportedOperationException: query result offset is not support

New Member 帖子: 6 加入日期: 11-12-12 最近的帖子
Hi everyone,

I am implementing pagination and I have problem with com.liferay.portal.kernel.dao.orm.QueryUtil class

When I call the method: public static List<?> list(Query query, Dialect dialect, int start, int end,boolean unmodifiable) in the above class:
When start = 0, the method work correctly
When start > 0 (example: start = 10) I get the error: java.lang.UnsupportedOperationException: query result offset is not supported

I see that this method use
query.setMaxResults(end - start);
query.setFirstResult(start);

so, it should be able to suport subset of return list but it doesn't.
Please help.
Thanks