spring boot jpa @Entity 报Error executing DDL错误的解决办法
Posted 微个日光日
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了spring boot jpa @Entity 报Error executing DDL错误的解决办法相关的知识,希望对你有一定的参考价值。
错误如下:
Error executing DDL "create table good (id bigint not null, cateid bigint, count bigint, createtime bigint, desc varchar(255), discount integer, imgurl varchar(255), name varchar(255), price bigint, saled bit, updatetime bigint, primary key (id)) engine=InnoDB" via JDBC Statement
org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "create table good (id bigint not null, cateid bigint, count bigint, createtime bigint, desc varchar(255), discount integer, imgurl varchar(255), name varchar(255), price bigint, saled bit, updatetime bigint, primary key (id)) engine=InnoDB" via JDBC Statement
代码如下:
这是因为desc是mysql的关键字,解决版办法就是:另外取一个名字(推荐)
以上是关于spring boot jpa @Entity 报Error executing DDL错误的解决办法的主要内容,如果未能解决你的问题,请参考以下文章
spring boot + JPA + MySql + Entity 表生成大写
spring boot: spring-data-jpa (Repository/CrudRepository) 数据库操作, @Entity实体类持久化
spring boot配置spring-data-jpa的时候报错CannotCreateTransactionException: Could not open JPA EntityManager
为什么Spring boot JPA本机更新通过postgres数据库提供PSQLException?
spring boot配置spring-data-jpa的时候报错CannotCreateTransactionException: Could not open JPA EntityManager