jpa自动建表出错
来源:互联网 发布:我的淘宝店铺链接地址 编辑:程序博客网 时间:2024/06/06 04:44
最近一个项目用的ssh,我从svn上checkout项目之后启动(配置的是hibernate.hbm2ddl.auto=update),结果表没有自动生成(表不存在),然后看控制台,控制台提示创建表失败,把创建语句拿出来是:
HHH000388: Unsuccessful: create table t_user (user_id bigint not null auto_increment, card_number varchar(30), card_type varchar(20), company_name varchar(200), email varchar(100), gender varchar(100) not null, identity varchar(20), job_name varchar(60), mobile varchar(30) not null, password varchar(100) not null, real_name varchar(100) not null, primary key (user_id)) type=InnoDB
2014-11-10 10:27:10,749 ERROR (org.hibernate.tool.hbm2ddl.SchemaUpdate:237) - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'type=InnoDB' at line 14
2014-11-10 10:27:10,756 ERROR (org.hibernate.tool.hbm2ddl.SchemaUpdate:236) - HHH000388: Unsuccessful: create table t_word (word_id bigint not null auto_increment, content longtext not null, create_date datetime, modify_date datetime, title varchar(100) not null, author_id bigint, primary key (word_id)) type=InnoDB
2014-11-10 10:27:10,763 ERROR (org.hibernate.tool.hbm2ddl.SchemaUpdate:237) - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'type=InnoDB' at line 9
2014-11-10 10:27:10,767 ERROR (org.hibernate.tool.hbm2ddl.SchemaUpdate:236) - HHH000388: Unsuccessful: create table t_wordreply (reply_id bigint not null auto_increment, content longtext not null, reply_date datetime, replier_id bigint, word_id bigint, primary key (reply_id)) type=InnoDB
可以看到自后都是type=InnoDB,网上搜索了之后,原来是type=InnoDB 是5.0之前使用的,我的数据库是5.5的
这个时候需要把hibernate中mysql的方言改一下,
原来的:hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
改成:hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
- jpa自动建表出错
- Spring data jpa配置出错
- Java-解决实现JPA的hibernate自动建表的编码问题
- JPA自动生成数据表
- jPA自动创建数据库表的一些配置
- jPA自动创建数据库表的一些配置
- jPA自动创建数据库表的一些配置
- JPA不能自动创建表结构的问题解决
- springboot JPA项目部署JBOSS出错
- 使用Mysql 5.5数据库Hibernate自动建表创建表出错table doesn't exist
- JPA不能自动生成主键
- matlab出错自动中断
- MySQL建表出错
- shell 语句出错自动退出
- xcode自动镜像后编译出错
- shell 语句出错自动退出
- Spring Test 自动装配出错
- Spring Data JPA 配置数据库表根据实体属性自动创建表结构
- Linux学习笔记(二)
- 如何将本地计算机的文件复制到外网连接的计算机上
- 设计模式之策略者模式
- [LeetCode]Longest Increasing Path in a Matrix
- c++实验报告 打印图形
- jpa自动建表出错
- 泛型T约束
- 安装cnpm加快npm install安装速度
- eclipse安装cdt插件
- getString(int resId, Object... formatArgs)的用法
- 转盘
- 编写优质嵌入式C程序
- nodejs 异步io 解决for循环最佳方案
- android dpi dip px