You do understand that the JPA specification requires that, and I cite from the Javadoc of Predicate#getExpressions:
Modifications to the list do not affect the query.
So your code is broken and only worked by accident in previous Hibernate versions. The proper way to do this is:
Predicate conjuncion = builder.conjunction();
Predicate expr = builder.equal(rootClaseGrid.get("documento"), "AAAA");
cq.where(builder.and(conjunction, expr));
Since the Javadoc seem to imply that modifications are allowed, I agree that this is a bug. The bug is, that we should return mutable lists, possibly copies of the original list. |