setFirstResult causes Parameters is not matched exception

Description

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;
}
}

Activity

Brett MeyerOctober 31, 2013 at 12:13 PM

These types of questions are best started in the user forums: https://forum.hibernate.org/viewforum.php?f=1. Please open JIRA tickets only for concise, reproduceable issues with attached test cases or for new features. Thanks

Rejected

Details

Assignee

Reporter

Affects versions

Priority

Created March 15, 2011 at 11:49 AM
Updated October 31, 2013 at 12:13 PM
Resolved October 31, 2013 at 12:13 PM

Flag notifications