Skip to content

Conversation

@cigaly
Copy link
Contributor

@cigaly cigaly commented Dec 19, 2024

Only added simple query to existing test class org.hibernate.processor.test.data.multivaluebinding.TopicPostTest

from Post p where p.name = lower(:name)

Parameter is properly handled in PostRepository_, but not in Ṗost_`. Former can be expected since there method parameter type are retrieved from method signature.

Two things are wrong - lesser evil is that parameter type has not been recognized as String, but this will still create usable method. Much bigger problem is that due to fact that allow multi value binding returns false parameter type is List.

Tested with SqmNamedParameter, very likely that same problem is with SqmPositionalParameter as well.

Possible source of problem may be org.hibernate.query.hql.internal.SemanticQueryBuilder#visitFinalFunctionArgument, but I may be very wrong.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


Passing for Jakarta Data meta model class, but for JPA is failing
- Parameter is List<Object> instead of String
@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Dec 19, 2024

Thanks for your pull request!

This pull request does not follow the contribution rules. Could you have a look?

❌ All commit messages should start with a JIRA issue key matching pattern HHH-\d+
    ↳ Offending commits: [f543833]

› This message was automatically generated.

@gavinking
Copy link
Member

Yeah, OK, so this really is a thing where HQL itself is too permissive. Believe it or not, it's actually a feature (or, rather, misfeature) that we tolerate varargs in function calls. And it's unfortunate that HQL doesn't currently infer the type of a parameter when it's used as an argument to a function.

[But those are nothing both issues with HQL itself, it's not Hibernate Processor at fault here.]

@cigaly
Copy link
Contributor Author

cigaly commented Dec 20, 2024

It seems that in this case complete HHH-18960 should be reverted, it has been made with wrong assumptions :-(

@cigaly cigaly closed this Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants