Christian Beikov (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HHH-15452 (
https://hibernate.atlassian.net/browse/HHH-15452?atlOrigin=eyJpIjoiMmI3ND...
)
Re: Predicate add expression results in UnsupportedOperationException (
https://hibernate.atlassian.net/browse/HHH-15452?atlOrigin=eyJpIjoiMmI3ND...
)
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.
(
https://hibernate.atlassian.net/browse/HHH-15452#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15452#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100204- sha1:f005d5a )