Cannot use full qualified enum name which has two uppercase alphabet prefix

Description

Hi,
I found that this sql will throw error: Invalid path: 'io.github.zhengyhn.practice.hibernate.ABStatus.A'.

But the below sql works.

I read the code and found this is because of these lines of code in org.hibernate.internal.util.ReflectHelper.

And the JAVA_CONSTANT_PATTERN is as below.

This pattern indicate that the constant name must begin with an upper case alphabet. So "ABStatus" cannot be recognized as valid constant name.

However, in my real-world project, we use GSStatus as the enum class name. I have to change it to GsStatus currently.

I suggest changing this pattern to

I have written a simple project for finding this issue. You can refer it as reference. https://github.com/zhengyhn/java-practice/tree/master/hibernate-enum

Environment

None

Activity

Show:
zheng hank
June 11, 2020, 9:03 AM
Edited

Hi, I create a pull request here: .

Assignee

Unassigned

Reporter

zheng hank

Fix versions

Labels

backPortable

Backport?

Suitable for new contributors

Yes, likely

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure