package com.example.demo.domain;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
/**
* @author wuxk07
*/
@Entity//
public class Girl {
@Id
@GeneratedValue
private Integer id;
private String cupSize;
private Integer age;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCupSize() {
return cupSize;
}
public void setCupSize(String cupSize) {
this.cupSize = cupSize;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
}
application.properties:
#ddl-auto:create:表示每次执行程序都会创建一个新的表,如果之前有这个表,会将这个表给删掉。
#ddl-auto:update:如果没有这个表会创建新表,如果有这个表并且表中有数据,不会删除表中的数据。
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
运行后会在数据库生成新表