## MySQL映射问题,自动按实体类生成表
配置
Mysql属性配置文件,Spring-boot系统配置
jpa.database-platform= org.hibernate.dialect.MySQL5Dialect
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/xxx?useSSL=false
spring.datasource.username=root
spring.datasource.password=123456
配置自动建表:updata:没有表新建,有表更新操作,控制台显示建表语句
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.format-sql= true
实体类
@Entity
public class Node {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(nullable = false)
private Long id;
@Column
private Integer blockNumber;
}