AuditReader find method throws an error

Description

Dear Hibernate team,

I've encountered a problem with my application when upgrading Hibernate from version 4 to 5.
Its origin seem to be an enum: when debugging, I get an error "BillStatus is not an enum type", which of course is wrong since it exists and has always worked so far.

Because of how massive the application is, I can't find a way to directly build a test case easily, so I'll do my best to provide as much information as possible about the issue.

The enum causing the error is the following:

My Bill item is the following:

And lastly, in another file, the line causing the error:

id and lastRevision are non null integers. The stack trace is the following:

The issue seemed to be somewhat similar to another one:
https://hibernate.atlassian.net/browse/HHH-12396
But I haven't found any clue to solve my problem.

When reverting back from Hibernate 5.4.3.Final to Hibernate 4.3.5.Final, the problem disapears.

Environment

Java 8 update 161, Glassfish 4, Hibernate 5.4.3.Final, PostgreSQL 10

Status

Assignee

Unassigned

Reporter

Yozamu

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

4.3.12

Components

Affects versions

Priority

Major
Configure