Ruben Gehring (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=6401f5e...
) *commented* on HHH-16986 (
https://hibernate.atlassian.net/browse/HHH-16986?atlOrigin=eyJpIjoiMGE2OT...
)
Re: CoercionException caused by attempted coercion of query param to entity field type (
https://hibernate.atlassian.net/browse/HHH-16986?atlOrigin=eyJpIjoiMGE2OT...
)
Ah, didn’t see your response when I posted my last one 😄
In any case I agree that “would be nice but technically speaking it’s not feasible” is
often a reasonable answer to these kinds of problems. The general problem of having any
kind of operand in any kind of operation seems hard I agree. And I can understand that
you’d prefer not to build a thousand special cases and exceptions, I wouldn’t want to do
that either.
Mostly it seemed to me that Hibernate basically does parameter resolving and type casting
correctly in most other cases and from the outside it’s not obvious that it’s easier for
hibernate to identify param types correctly in calculations like ?1 * ?2 than in
calculations like test.intField * ?1. Plausibly it is much harder to get the latter right,
I don’t know, but I hope you can understand the confusion and why my default expectation
was that if the first works then the second should probably work, too.
In any case, explicit casting does indeed work, although I’m still figuring out which
parts of the query I have to cast explicitly in order for hibernate to deduct all involved
operands correctly.
(
https://hibernate.atlassian.net/browse/HHH-16986#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16986#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#100233- sha1:f5b6255 )