setFirstResult causes Parameters is not matched exception
---------------------------------------------------------
Key: HHH-6017
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-6017
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.6.2
Environment: Hibernate environment version :
spring-orm-3.0.4.RELEASE.jar
hibernate-distribution-3.6.2.Final.jar
commons-collections-3.2.1.jar
antlr-2.7.6.jar
dom4j-1.6.1.jar
slf4j-api-1.6.1.jar
Database platform :
Oracle 10g
Reporter: seungu lee
Priority: Critical
setFirstResult function causes "Parameters is not matched Bind var('?') count
2 And parameters counts are 1 [21]" Exception
See below execute log
[2011-03-15 18:46:50] [ERROR]『core.log.exception.InternalException:<init>(32)』
Parameters is not matched
Bind var('?') count 2 And parameters counts are 1 [21]
Query:
select
*
from
( select
row_.*,
rownum rownum_
from
( select
user0_.USER_ID as USER1_0_,
user0_.LOGIN_ID as LOGIN2_0_,
user0_.LOGIN_PASSWD as LOGIN3_0_,
user0_.USER_NAME as USER4_0_,
user0_.USER_DESC as USER5_0_,
user0_.HASH_TYPE as HASH6_0_,
user0_.LAST_ACCESS_TM as LAST7_0_
from
AA_USER user0_ ) row_
where
rownum <= ?/**P*/
)
where
rownum_ > ?/**P*/
/////////////////////
source
import java.util.List;
import org.hibernate.Query;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.nbpcorp.newproj.domain.User;
public class UserDAO extends HibernateDaoSupport {
public void init(SessionFactory sessionFactory) {
setSessionFactory(sessionFactory);
}
public List selectUserList() {
Query query = this.getSession().createQuery("from " + User.class.getName());
query.setFirstResult(10);
query.setMaxResults(10 + 1);
List list = query.list();
return list;
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira