public List<T> execute(Session session) {
CriteriaBuilder builder = session.getCriteriaBuilder();
CriteriaQuery<T> cr = builder.createQuery(clazz);
Root<T> root = cr.from(clazz);
Predicate pred = builder.equal(root.get("property"), value)
Query<T> query = session.createQuery(cr);
cr.where(pred)
return query.getResultList();
}
This fails with an exception
java.lang.IllegalStateException: Criteria parameter [org.hibernate.query.sqm.tree.expression.ValueBindJpaCriteriaParameter@41956b37] not known to be a parameter of the processing tree
//BaseSqmToSqlAstConverter.java
final SqmJpaCriteriaParameterWrapper<?> supplier = jpaCriteriaParamResolutions.get( expression ); // this map exists but is empty
if ( supplier == null ) {
throw new IllegalStateException( "Criteria parameter [" + expression + "] not known to be a parameter of the processing tree" );
}
return supplier;
I can’t see any information or posts about this specific error message anywhere.
If I remove the predicate the query loads ok.
I’m on hibernate-core-6.5.2.Final and jakarta.persistence-api-3.1.0.jar