从休眠 5.6.8 迁移到 6.1.7 后,我得到这个:错误:模式“s1_0”不存在

问题描述 投票:0回答:0

我已经将我的

spring-boot-starter-parent
版本从
2.6.7
增加到
3.0.4
。较旧的使用
hibernate 5.6.8
,较新的使用
6.1.7
。我已经将所有
javax.persistance
改编为
jakarta.persistance
,还有所有必需的注释和一般代码。但是,当我运行它并尝试查询特定表时(注意:发现它只发生在这个表上)我得到以下信息

o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 0, SQLState: 3F000 o.h.engine.jdbc.spi.SqlExceptionHelper   : ERROR: schema "s1_0" does not exist Position: 263

o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.springframework.orm.jpa.JpaSystemException: JDBC exception executing SQL [select s1_0.id,s1_0.absence,s1_0.active_state,s1_0.activity_id,s1_0.bad_weather,s1_0.checked,s1_0.cost_center_id,s1_0.employee_id,s1_0.end_date_time,s1_0.end_coordinates_id,s1_0.end_date_time + make_interval( CAST(9000 - extract(YEAR from s1_0.end_date_time) AS s1_0.int4), CAST(12 - extract(MONTH from s1_0.end_date_time) AS s1_0.int4), 0, CAST(31 - extract(DAY from s1_0.end_date_time) AS s1_0.int4), 0, 0) ,s1_0.exact_end_date_time,s1_0.exact_start_date_time,s1_0.is_break,s1_0.locked,s1_0.recorded_manually,s1_0.recorder_id,s1_0.sent_end_from_device,s1_0.sent_start_from_device,s1_0.site_manager_id,s1_0.staff_time_group_uuid,date_trunc('day', s1_0.start_date_time),s1_0.start_date_time,s1_0.begin_coordinates_id,s1_0.start_date_time + make_interval( CAST(9000 - extract(YEAR from s1_0.start_date_time) AS s1_0.int4), CAST(12 - extract(MONTH from s1_0.start_date_time) AS s1_0.int4), 0, CAST(31 - extract(DAY from s1_0.start_date_time) AS s1_0.int4), 0, 0) ,extract(EPOCH from (s1_0.end_date_time - s1_0.start_date_time)) ,s1_0.task_id,s1_0.text,s1_0.updated_at from public.staff_time s1_0

org.postgresql.util.PSQLException: ERROR: schema "s1_0" does not exist at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676) ~[postgresql-42.5.1.jar:42.5.1]

根据我的理解,不应该有架构

s1_0
,那应该是一个表。其他表没有问题。至少当我为
repository.findAll()
尝试不同的方法时,它对除此之外的所有人都有效。

我尝试在所有

@OneToOne
@ManyToOne
@OneToMany
中添加一个懒惰的fethType
(fetch = FetchType.LAZY)
。它确实对类似的事情有所帮助,但在这里没有帮助。

我尝试将表从

staff_time
重命名为
table_staff_time
,以查看休眠时是否创建查询,
s1_0
是否保留用于模式或其他内容,但同样,它是相同的并且它尝试了同名(试图从正确的表中获取,但无济于事)

我迷路了,我不知道还能尝试什么。

java spring-boot hibernate migration schema
© www.soinside.com 2019 - 2024. All rights reserved.