Skip to content

HHH-15497 Count query when counting polymorphic subclasses by type fails when run twice #5275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

dreab8
Copy link
Member

@dreab8 dreab8 commented Sep 12, 2022

https://hibernate.atlassian.net/browse/HHH-15497,

When a query is executed a second time the binding type adjustment is not executes, so aligning the SqmParameter expressible type with the binding type while converting SQM->AST will ensure that even for the following query execution the binding type will be correct one

@dreab8 dreab8 requested review from sebersole and beikov September 12, 2022 15:10
@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Sep 12, 2022

Thanks for your pull request!

This pull request appears to follow the contribution rules.

› This message was automatically generated.

@@ -156,4 +156,8 @@ public JpaSelection<T> alias(String name) {
public JavaType<T> getJavaTypeDescriptor() {
return getNodeType() == null ? null : getNodeType().getExpressibleJavaType();
}

public void forceInferableType(SqmExpressible<?> type){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should move the logic from org.hibernate.query.internal.QueryParameterBindingImpl#setType to AbstractSqmParameter#applyInferableType and call that method instead. Changing the type of the parameter binding is a no-go AFAIU from our last discussion, so we shouldn't do it and deprecate the setType method.

@dreab8
Copy link
Member Author

dreab8 commented Sep 14, 2022

superseded by #5277

@dreab8 dreab8 closed this Sep 14, 2022
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