Position beyond number of declared ordinal parameters. Remember that ordinal parameters are 1-based! Position: 2
org.hibernate.QueryParameterException: Position beyond number of declared ordinal parameters. Remember that ordinal parameters are 1-based! Position: 2
org.hibernate.engine.query.spi.ParameterMetadata.getOrdinalParameterDescriptor(ParameterMetadata.java:80)
org.hibernate.engine.query.spi.ParameterMetadata.getOrdinalParameterExpectedType(ParameterMetadata.java:86)
org.hibernate.internal.AbstractQueryImpl.determineType(AbstractQueryImpl.java:444)
org.hibernate.internal.AbstractQueryImpl.setParameter(AbstractQueryImpl.java:416)
百度查看大佬的文章,这个错误出错的原因多半是中英字符运用错误,比如逗号或者问号。
String hql = “from com.sharingbike.www.pojo.Images where bid = ? and bic = ?”;
我出错的地方就是第二个问号用的中文拼音的问号。