更新时间:2022-10-20 09:03:31
因为您使用的是内存数据库,所以Hibernate在执行时不会找到任何表:
hibernate.hbm2ddl.auto=create-drop
这是因为语句顺序是:
创建约束(FK)
Query:{[alter table tableIdentifier drop constraint FK_202gbutq8qbxk0chvcpjsv6vn][]}
ERROR [main]: o.h.t.h.SchemaExport - HHH000389: Unsuccessful: alter table tableIdentifier drop constraint FK_202gbutq8qbxk0chvcpjsv6vn
ERROR [main]: o.h.t.h.SchemaExport - user lacks privilege or object not found: PUBLIC.TABLEIDENTIFIER
Query:{[drop table sequenceIdentifier if exists][]}
Query:{[drop table tableIdentifier if exists][]}
Query:{[create table sequenceIdentifier (id bigint not null, primary key (id))][]}
Query:{[create table tableIdentifier (id bigint not null, sequenceIdentifier_id bigint, primary key (id))][]}
Query:{[alter table tableIdentifier add constraint FK_202gbutq8qbxk0chvcpjsv6vn foreign key (sequenceIdentifier_id) references sequenceIdentifier][]}
Query:{[create sequence hibernate_sequence start with 1 increment by 1][]}
您可以通过将hibernate.hbm2ddl.auto更改为更新来修复此问题:
hibernate.hbm2ddl.auto=update