mysql jpa 不要自动建表_jpa无法自动创建数据库表

下面是配置信息:

spring.jpa:

show-sql: true

database: MYSQL

properties.hibernate.dialect: org.hibernate.dialect.MySQL5Dialect

hibernate:

ddl-auto: update

naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy

spring.datasource:

driver-class-name: com.mysql.cj.jdbc.Driver

url: jdbc:mysql://192.168.1.115/ssm?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true&serverTimezone=CTT

username: admin

password: 123456

initial-size: 10

max-wait: 10000

maximum-pool-size: 100

max-active: 100

max-idle: 10

minIdle: 2

test-on-borrow: false

test-on-return: true

test-while-idle: true

validation-query: select 1

下面是实体类:

@Entity

@Table(name = "ssm_icon")

public class Icon {

/**

* 主键id

*/

@Id

@GeneratedValue(strategy = GenerationType.AUTO)

@Column(name = "id")

private Long id;

/**

* 图标名称

*/

@Column(name = "icon_name")

private String iconName;

/**

* 图标地址

*/

@Column(name = "icon_address")

private String iconAddress;

/**

* 图标编码

*/

@Column(name = "icon_code")

private String iconCode;

public Long getId() {

return id;

}

public void setId(Long id) {

this.id = id;

}

public String getIconName() {

return iconName;

}

public void setIconName(String iconName) {

this.iconName = iconName;

}

public String getIconAddress() {

return iconAddress;

}

public void setIconAddress(String iconAddress) {

this.iconAddress = iconAddress;

}

public String getIconCode() {

return iconCode;

}

public void setIconCode(String iconCode) {

this.iconCode = iconCode;

}

}

今天新建的一个srping boot项目无法jpa无法自动生成数据库表,把ddl-auto 换成create也不行,哪位大神可以帮忙看看是什么原因吗

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值