You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
org.postgresql.util.PSQLException: ERROR: operator does not exist: status_enum = character varying exception after migrating Spring 3 with Hibernate 6.3.1
#660
Closed
JotDakha opened this issue
Oct 5, 2023
· 1 comment
@vladmihalcea Earlier I was using hibernate-types-52 library to support for PostgreSQLEnumType with Hibernate @typedefs. But after migration, hypersistence-utils-hibernate has been updated to support Postgres custom enum datatypes.
(looking for a solution and by referring to this ticket:- #514) @Enumerated(EnumType.STRING) @column(columnDefinition = "status_enum") @type(PostgreSQLEnumType.class)
private Status status
exception getting - Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: status_enum = character varying_
And if I am lowering the hibernate version to 6.2.9, then getting the exception.
Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column [status] in table [user]; found ["status_enum" (Types#VARCHAR)], but expecting [status_enum (Types#OTHER)]
Hibernate 6.3 support should be implemented via #657.
If you need this feature, then you should definitely send me a Pull Request with the fix for that issue. I won't have the time to implement it myself, but I could review it for you when you are done.
By the way, after looking at the Hibernate forum discussion you mentioned, it looks like you are using an ancient version of the library.
Try migrating to Hypersistence Utils instead of the old Hibernate Types dependency and give it a try with Hibernate 6.2.
@vladmihalcea Earlier I was using hibernate-types-52 library to support for PostgreSQLEnumType with Hibernate @typedefs. But after migration, hypersistence-utils-hibernate has been updated to support Postgres custom enum datatypes.
(looking for a solution and by referring to this ticket:- #514)
@Enumerated(EnumType.STRING)
@column(columnDefinition = "status_enum")
@type(PostgreSQLEnumType.class)
private Status status
exception getting - Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: status_enum = character varying_
And if I am lowering the hibernate version to 6.2.9, then getting the exception.
Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column [status] in table [user]; found ["status_enum" (Types#VARCHAR)], but expecting [status_enum (Types#OTHER)]
Attaching ticket opened with hibernate team - https://discourse.hibernate.org/t/cannot-invoke-org-hibernate-boot-spi-metadatabuildingcontext-getmetadatacollector-because-this-metadatabuildingcontext-is-null/8298
Please suggest to resolve this issue or let me know if I missed any steps.
The text was updated successfully, but these errors were encountered: