Следуя рекомендациям, я изменил файлы миграции sql, чтобы использовать bytea вместо oid, и настроил соответствующий orm.xml.
Код: Выделить всё
org.hibernate.Exception.SQLGrammarException: не удалось выполнить
оператор [ОШИБКА: столбец «meta_data» имеет тип bytea, но выражение
типа bigint Подсказка: вам нужно будет переписать или привести
выражение. Позиция: 179] [insert in domain_event_entry
(aggregate_identifier,event_identifier,meta_data,payload,payload_revision,payload_type,sequence_number,time_stamp,type,global_index)
значения (?,?,?,?,?,?,?,?,?,?)]
Определение таблицы записей событий домена:
Код: Выделить всё
create table public.domain_event_entry
(
global_index bigserial
constraint pk_domain_event_entry
primary key,
aggregate_identifier varchar(255) not null,
sequence_number bigint not null,
type varchar(255),
event_identifier varchar(255) not null
constraint uk_domain_event_entry_identifier
unique,
meta_data bytea,
payload bytea not null,
payload_revision varchar(255),
payload_type varchar(255) not null,
time_stamp varchar(255) not null,
constraint uk_domain_event_entry
unique (aggregate_identifier, sequence_number)
);
create unique index idx_domain_event_entry_aggregate_seq
on public.domain_event_entry (aggregate_identifier, sequence_number);
create unique index idx_domain_event_entry_event_id
on public.domain_event_entry (event_identifier);
Код: Выделить всё
spring.datasource.driverClassName=org.postgresql.Driver
spring.jpa.database-platform=com.haufe.zeva.infrastructure.persistence.ByteaEnforcedPostgresSQLDialect # the dialect I copied from the documentation
spring.jpa.generate-ddl=false
spring.jpa.hibernate.ddl-auto=none
spring.jpa.properties.hibernate.hbm2ddl.auto=none
spring.jpa.properties.jakarta.persistence.schema-generation.database.action=none
spring.jpa.properties.jakarta.persistence.schema-generation.create-source=none
spring.jpa.properties.jakarta.persistence.schema-generation.drop-source=none
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
spring.jpa.hibernate.naming.strategy=org.hibernate.cfg.EJB3NamingStrategy
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.jpa.open-in-view=false
spring.jpa.properties.hibernate.multiTenancy=DISCRIMINATOR
spring.jpa.properties.hibernate.tenant_identifier_resolver=com.som.path.TenantResolver
spring.jpa.properties.hibernate.hbm2ddl.halt_on_error=false
# axon framework
axon.axonserver.enabled=false
Подробнее здесь: https://stackoverflow.com/questions/797 ... ot-working
Мобильная версия