Skip to content

Conversation

@jwgmeligmeyling
Copy link
Contributor

@jwgmeligmeyling jwgmeligmeyling commented Mar 16, 2023

Reproducer that argument type is not properly resolvable from SqmFunction return type resolvers.

Test fails with:

Unexpected type ==> expected: <org.hibernate.type.CustomType> but was: <org.hibernate.metamodel.model.domain.internal.BasicTypeImpl>
Expected :org.hibernate.type.CustomType
Actual   :org.hibernate.metamodel.model.domain.internal.BasicTypeImpl

@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Mar 16, 2023

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: [782b487]

› This message was automatically generated.

@jwgmeligmeyling
Copy link
Contributor Author

jwgmeligmeyling commented Mar 16, 2023

A "work around" seems to be to get the entity name and attribute name from the SqmTypedNode and look it up in the Metamodel, although this requires access to the SessionFactory which is only accessible through a deprecated method:

typeConfiguration.getSessionFactory().getMappingMetamodel()
     .getEntityDescriptor(((SqmRoot) ((SqmBasicValuedSimplePath) arguments.get(0)).getLhs()).getEntityName())
    .getPropertyType(((SqmBasicValuedSimplePath) arguments.get(0)).getNavigablePath().getLocalName());
							

@beikov
Copy link
Member

beikov commented Dec 27, 2024

It looks like this was already merged and fixed as part of #6780

@beikov beikov closed this Dec 27, 2024
@jwgmeligmeyling jwgmeligmeyling deleted the reproducer branch December 27, 2024 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants