課程
/后端開發(fā)
/Java
/2小時(shí)學(xué)會(huì)Spring Boot
運(yùn)行后,數(shù)據(jù)庫中沒有看到新建的表格
2018-09-06
源自:2小時(shí)學(xué)會(huì)Spring Boot 5-1
正在回答
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; ????} }
貼上代碼看看
舉報(bào)
Spring Boot入門視頻教程,你將學(xué)會(huì)使用Spring Boot快速構(gòu)建應(yīng)用程序
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2018-09-06
2018-09-06
貼上代碼看看