我正在尝试使用 JPA 生成表。但我无法创建它。代码没有错误,但是好像有配置错误。但我找不到它,我尝试了很多配置但没有任何反应。非常感谢。
这是application.property:
spring.datasource.url=jdbc:mysql://localhost:3306/springapp
spring.datasource.username= root
spring.datasource.password= me
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.hibernate.ddl-auto=create
Run Code Online (Sandbox Code Playgroud)
这是我的课:
@Entity
public class Customer {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private int id;
private String name;
private String phone;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public Customer(String …Run Code Online (Sandbox Code Playgroud)