没有自动新建表
运行后,数据库中没有看到新建的表格
运行后,数据库中没有看到新建的表格
2018-09-06
server: port: 8080 boy: height: 171cm age: 22 #content: "身高:${height},年龄:${age}" datasource: driver-class-name: com.mysql.jdbc.Driver url: jdbc:mysql://127.0.0.1:3307/dbboy usename: root password: 960328 jpa: hibernate: hbm2ddl-auto: create show-sql: true
package com.example.entity; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; /** * Create by 土豆儿 * 2018/9/6 13:39 */ @Entity @Table(name="user") public class Boy { @Id @GeneratedValue private int id; private String height; private Integer age; public Boy() { } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getHeight() { return height; } public void setHeight(String height) { this.height = height; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } }
举报