不能自動生成表
spring:
?profiles:
? ?active: dev
?datasource:
? ?dbcp2:
? ? ?driver-class-name: com.mysql.jdbc.Driver
? ? ?url: jdbc:mysql://localhost:3306/dbgirl
? ? ?username: root
? ? ?password: root
? ? ?default-auto-commit: true
?jpa:
? ?show-sql: true
? ?hibernate:
? ? ?ddl-auto: create
package com.bobo;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "girl")
public class Girl {
? ?@Id
? ?@GeneratedValue
? ?private Integer id;
? ?private String cupSize;
? ?private Integer age;
? ?public Girl() {
? ?}
? ?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;
? ?}
}
控制臺也沒有報錯,表也生成不了
2018-05-11
我感覺還是配置文件的問題你在仔細看看
2018-03-06
配置的時候去掉dbcp2: