【发布时间】:2018-12-19 15:42:21
【问题描述】:
我正在尝试基于实体生成架构表。但是没有创建表。怎么了?
实体示例:
@Entity
@NoArgsConstructor
@Getter @Setter
public class User {
@Id @GeneratedValue(strategy = GenerationType.AUTO)
public Long id;
public String username;
public String password;
public User(String username, String password) {
this.username = username;
this.password = password;
}
public User(String username) {
this(username, username + "pass");
}
}
application.properties:
spring.datasource.url=jdbc:postgresql://localhost:5432/dbtest
spring.datasource.username=vssekorin
spring.datasource.password=
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.ddl-auto=update
依赖关系:
compile('org.springframework.boot:spring-boot-starter-data-jpa')
runtime('com.h2database:h2')
compile('org.telegram:telegrambots:3.6.1')
runtime('org.postgresql:postgresql')
compileOnly('org.projectlombok:lombok')
testCompile('org.springframework.boot:spring-boot-starter-test')
警告:GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement
【问题讨论】:
-
您能否显示此“GenerationTarget 遇到异常接受命令:通过 JDBC 语句执行 DDL 时出错”的完整日志
标签: java postgresql spring-boot spring-data