diff options
author | Sebastian Schmelzer | 2012-09-07 12:25:49 +0200 |
---|---|---|
committer | Sebastian Schmelzer | 2012-09-07 12:25:49 +0200 |
commit | 6a22a3ce71c55d7b9a6ab389c6c319b8b23f0b40 (patch) | |
tree | 15b8977a66a324988ff9cc63bad1b34e197e46e7 /src/main/java/nu/xss/jpa/dao | |
parent | use getter for accessing entityclass (diff) | |
download | xss-jpa-6a22a3ce71c55d7b9a6ab389c6c319b8b23f0b40.tar.gz xss-jpa-6a22a3ce71c55d7b9a6ab389c6c319b8b23f0b40.tar.xz xss-jpa-6a22a3ce71c55d7b9a6ab389c6c319b8b23f0b40.zip |
wicket's IDataProvider#iterator wants to have long instead of int -> update pagination class
Diffstat (limited to 'src/main/java/nu/xss/jpa/dao')
-rw-r--r-- | src/main/java/nu/xss/jpa/dao/GenericJpaDao.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/nu/xss/jpa/dao/GenericJpaDao.java b/src/main/java/nu/xss/jpa/dao/GenericJpaDao.java index c079f83..21a1e51 100644 --- a/src/main/java/nu/xss/jpa/dao/GenericJpaDao.java +++ b/src/main/java/nu/xss/jpa/dao/GenericJpaDao.java @@ -265,12 +265,13 @@ public abstract class GenericJpaDao<E extends TypedEntity<K>, K> implements // Result pagination TypedQuery<E> tq = getEntityManager().createQuery(q); + // TODO: do we need to check cast long->int? if (pagination != null) { if (pagination.getCount() > 0) { - tq.setMaxResults(pagination.getOffset()); + tq.setMaxResults((int) pagination.getOffset()); } if (pagination.getOffset() > 0) { - tq.setFirstResult(pagination.getCount()); + tq.setFirstResult((int) pagination.getCount()); } } |