在更改“spring.jpa.hibernate.ddl-auto”的值后重新启动 spring boot 应用程序时,我的表数据被删除

Vig*_*gan 5 spring spring-data-jpa spring-boot

在将 'spring.jpa.hibernate.ddl-auto' 的值从 'verify' 更改为 'create' 后,当我重新启动 Spring Boot 应用程序时,我的表数据被删除了。为什么会这样?我该怎么做才能取回我的数据?

我可以看到在我的 IDE 控制台中执行了一些 drop 查询。为什么会发生?有人可以解释一下吗?

snd*_*ndu 5

在 application.properties 中进行以下更改

spring.jpa.hibernate.ddl-auto=无


高慧觉*_*高慧觉 1

你可以阅读spring-boot的官方文档,该属性与hibernate配置hibernate.hbm2ddl.auto中相关。