Код: Выделить всё
@TypeDef(
name = "pgsql_enum",
typeClass = PostgreSQLEnumType.class
)
< /code>
и поле enum в моей сущности, как это: < /p>
@Enumerated(EnumType.STRING)
@Column(name = "status")
@Type(type = "pgsql_enum")
private StatusEnum status;`
< /code>
my statestenum определяется как: < /p>
public enum StatusEnum {
APPROVAL,
ACTIVE,
COMPLETED,
}
< /code>
В Postgresql мой перевод определяется как: < /p>
CREATE TYPE book.book_status_enum AS ENUM (
'APPROVAL',
'ACTIVE',
'COMPLETED'
);
< /code>
С момента перехода в Hibernate 6 я столкнулся с следующей ошибкой: < /p>
operator does not exist: book.book_status_enum = character varyingКогда я удаляю @enumerated (enumtype.string) аннотация, я встречаюсь:
Код: Выделить всё
operator does not exist: book.book_status_enum = integerЯ пробовал различные подходы, включая использование конвертеров, @type , jdbctype, @enumerated и columndefinition, но все приводят к той же ошибке. @Enumerated (enumtype.string)
[*] Создание пользовательского джакартского преобразователя
[*] Использование @jdbctypecode (sqltypes.enum) и @type (postgresqlenumtype.class)
аннотация
Ни один из этих подходов не решил проблему.>
Подробнее здесь: https://stackoverflow.com/questions/795 ... ping-issue