This problem is similar to HHH-15970 Closed , but still exists with Hibernate 6.1.7. It occurs when you have a generic @MappedSuperclass with an enum field that is mapped via a custom UserType. The databse field is generated as a bytea, where an integer type is expected. When saving an object, there is of course a type conflict. Please have a look at the attached test case. With Hibernate 6.1.7 and Postgres it fails as follows:
With Hibernate 6.2, however, it is successful. I couldn't find a suitable JIRA issue for it though. I would like to ask for a fix for 6.1. Because we are currently limited to JakartaEE 9.1, the use of Hibernate 6.2 is unfortunately not yet an option for us. |