hibernate异常坑人

org.hibernate.QueryParameterException: Position beyond number of declared ordinal parameters. Remember that ordinal parameters are 1-based! Position: 2

 

 

这异常提示的,明明是0-based!!!!!

 

doc写的清楚,position - the position of the parameter in the query string, numbered from 0.

 

http://docs.jboss.org/hibernate/orm/4.1/javadocs/org/hibernate/Query.html#setParameter%28int,%20java.lang.Object%29

 

你可能感兴趣的:(Hibernate)