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.