JPQL for Enum with converter does fail to build correct native query

Description

Failing test with JPQL: from Employee e where e.contractType = org.hibernate.test.converter.QueryTest.ContractType.INTERNAL

is proposed here: https://github.com/hibernate/hibernate-orm/compare/master...luvarqpp:patch-1

pull request:

I am not sure that query is correct (as ContractType enum is inner class for QueryTest class). If it is correct, problem leaves in select does not escape converted enum character.

Use case:

Enum ContractType should be stored in database as single character code (field can have @Column(length = 1)). JPQL with restriction to some particular enum value, does not escape converted character (i.e. select x from XXX x where x.y=C, instead of select x from XXX x where x.y='C'.

Environment

None

Assignee

Unassigned

Reporter

Lubomir Varga

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

Components

Priority

Major
Configure