Я столкнулся с проблемой в одном из моих проектов - создал локальный DB из файла дампа (Postgre 13), некоторые столбцы были определены как varchar [] и интервал. < /p>
CREATE TABLE public.table (
id integer DEFAULT 1 NOT NULL,
column_name character varying[]
);
< /code>
CREATE TABLE public.table_2_name (
id uuid NOT NULL,
another_column_name interval NOT NULL
);
< /code>
Fields for entities from these tables are defined like:
@Type(ListArrayType.class)
@Column(name = "COLUMN_NAME", columnDefinition = "varchar[]")
private List columnName;
< /code>
@Column(name = "ANOTHER_COLUMN_NAME")
private Duration anotherColumnName;
< /code>
But during startup I recieve this error from Hibernate:
Schema-validation: wrong column type encountered in column [column_name] in table [table_name]; found [_varchar (Types#ARRAY)], but expecting [varchar[] (Types#OTHER)]
< /code>
The same appears with:
Schema-validation: wrong column type encountered in column [another_column_name] in table [table_2_name]; found [interval (Types#OTHER)], but expecting [numeric(21,0) (Types#NUMERIC)]
< /code>
It seems that auto-created ddl is wrong. I cannot modify entities or any other properties in project, but I guess it's my local system issue. To ensure this, I tried to run the project with docer-compose - everything went fine and it started! Can you please suggest the possible reason of this happenning and the solution?
I've tried to switch Postgre versions, Hibernate versions, my thoughts were maube there is a problem with auto-generated ddl. Didn't work
Подробнее здесь: https://stackoverflow.com/questions/794 ... t-to-class
Classcast Exception Class org.hibernate.type.customtype не может быть поднят в класс org.hibernate.type.basicpluraltype ⇐ JAVA
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение