\r\nString hql = "select count(*) from Friend where userID = ?"; \r\nint totalCount = this.countByCondition(hql, userID); \r\n\r\n\r\n在查询的时候出现了java.lang.IndexOutOfBoundsException: Remember that ordinal parameters are 1-base错误,后来在网上查询了一下。,得知JPA的问号索引是从1开始的,而HibernateTemplate是从0开始的。\r\n\r\n