Wrong setting of enum parameter with JOIN in HQL query

Description

I'm using Hibernate 5.4.1 in my Spring Boot (REST, JPA, HATEOAS) application. I'm using Mysql 5.7.22 and org.hibernate.dialect.MySQL57Dialect dialect.
I'm using Mysql connector 8.0.12.

This is my enumeration class:

I've created a custom method in my repository class:

I did a JOIN with Customer on purpuse. Here you don't see any filter on customer's properties because it's not relevant for the explanation of the problem.

The query sent to Mysql is:

As you can see it's wrong: the enumeration is not translated well.

If I change the query removing the JOIN:

the query sent to Mysql this time is correct:

I found the problem, it seems to be the absense of the table qualifier in front of reasonForAdjustment property.
Even with JOIN, rewriting the query:

everything works. However I don't expect this behaviour, I think I should at least get a syntax exception in this case.

Environment

None

Assignee

Unassigned

Reporter

Daniele Renda

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Minor
Configure