-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: setMaxResults error
PostPosted: Mon Aug 14, 2006 10:01 am 
Newbie

Joined: Thu Jul 06, 2006 12:01 pm
Posts: 5
Im having a problem with this code:

Query q = em.createQuery("SELECT object(o) FROM DetalleListaE o WHERE" +
" o.idLista =?1");
q.setParameter(1, listaE);
q.setFirstResult(1);
q.setMaxResults(5);

im trying to do some pagination using this methods, the problem is in line q.setMaxResults(5), i get this exception:

08:46:37,000 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: 42601
08:46:37,000 ERROR [JDBCExceptionReporter] ERROR: syntax error at or near "limit"
08:46:37,000 ERROR [STDERR] javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
.....
...
..
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "limit"
08:46:37,062 ERROR [STDERR] at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1525)


my db is postgres 8.x and im using driver postgresql-8.1-407.jdbc2ee with
jboss 4.0.4CR2.

any comment will be Appreciated.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.