我在我的application.properties
文件中有这段代码:
# Spring DataSource
spring.datasource.driverClassName=org.postgresql.Driver
spring.sql.init.mode=always
spring.sql.init.platform=postgres
spring.datasource.url=jdbc:postgresql://localhost:5432/dbname
spring.datasource.username=postgres
spring.datasource.password=root
# JPA-Hibernate
spring.jpa.generate-ddl=true
spring.jpa.show-sql=false
spring.jpa.hibernate.ddl-auto=create
# https://dev59.com/9lcP5IYBdhLWcg3wvMdF
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
# Optimization for POSTGRES queries
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQL95Dialect
您可以看到,我已经添加了spring.jpa.hibernate.ddl-auto=create
这行,但是JPA仍然没有创建表。我必须手动创建它们才能让项目编译通过。有什么问题吗?