我正在使用现有的 oracle 11g DB 创建一个 spring 项目。 我已经设置了 hibernate ddl-auto : update 属性,以便将不存在的列添加到数据库中。
问题在于,当启动应用程序时,Hibernate 试图创建表而不是更改和添加列。
这是我的 application.yml :
spring:
datasource:
url: jdbc:oracle:thin:@//localhost:1234/XE
username: user
password: pass
jpa:
generate-ddl: true
hibernate:
ddl-auto: update
properties:
hibernate:
temp:
use_jdbc_metadata_defaults: false
dialect: org.hibernate.dialect.Oracle12cDialect
physical_naming_strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
show-sql: true
你能帮我理解为什么它要创建所有表而不是改变它们。