H2和Hibernate:ERROR: org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful: create table
来源:互联网 发布:线上抽签软件 编辑:程序博客网 时间:2024/05/21 09:37
今天一如继往的用hibernate和H2,结果试图保存对象Order时,出错了。并且连这个表都创建不了。
INFO :org.hibernate.tool.hbm2ddl.DatabaseMetadata - table not found: order
ERROR:org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful: create table order (idinteger generated by default as identity, number varchar(255), primary key(id))
ERROR:org.hibernate.tool.hbm2ddl.SchemaUpdate - Syntax error in SQL statement"CREATE TABLE ORDER[*] (ID INTEGER GENERATED BY DEFAULT AS IDENTITY,NUMBER VARCHAR(255), PRIMARY KEY (ID)) "; expected "identifier";SQL statement:
create table order(id integer generated by default as identity, number varchar(255), primary key(id)) [42001-144]
INFO :org.hibernate.tool.hbm2ddl.SchemaUpdate - schema update complete
Hibernate: insertinto order (id, number) values (null, ?)
WARN :org.hibernate.util.JDBCExceptionReporter - SQL Error: 42001, SQLState: 42001
ERROR:org.hibernate.util.JDBCExceptionReporter - Syntax error in SQL statement"INSERT INTO ORDER[*] (ID, NUMBER) VALUES (NULL, ?) "; expected"identifier"; SQL statement:
insert into order(id, number) values (null, ?) [42001-144]
org.hibernate.exception.SQLGrammarException:could not insert: [com.gathershell.domain.Order]
atorg.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
atorg.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
atorg.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:64)
网上查了查说的也不太懂,最后我用它自带的控制台手动创建表,把它例子中的表名TEST改为ORDER后就出错了。那还能说什么呢?这个名子不要用。我把它改为其它名子果然就可以了。不过这应不是根本原因。
- H2和Hibernate:ERROR: org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful: create table
- [org.hibernate.tool.hbm2ddl.SchemaUpdate] - Unsuccessful: create table
- org.hibernate.tool.hbm2ddl.SchemaUpdate execute ERROR: HHH000319: Could not get database metadata
- 九月 07, 2015 6:25:28 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute ERROR: HHH000388: Unsuccess
- hibernate遇到Unsuccessful: create table问题
- ERROR: HHH000388: Unsuccessful: create table
- Hibernate Tool: hbm2java or hbm2ddl
- Hibernate Tool: hbm2java or hbm2ddl
- Hibernate's hbm2ddl tool & hibernate.hbm2ddl.auto options
- hibernate生成数据表时报错: Unsuccessful: create table NEWS (ID integer not null auto_increment, TITLE varcha
- hibernate生成数据表时报错:HHH000388: Unsuccessful: create table emp (empid integer generated by default as i
- hibernate.hbm2ddl
- Hibernate hbm2ddl
- [Hibernate]SchemaUpdate建立索引问题
- Hibernate SchemaUpdate建立索引问题
- [Hibernate]SchemaUpdate建立索引问题
- Summary on 20080626: hibernate configuration and hbm2ddl tool
- ERROR: HHH000388: Unsuccessful: create table right (right_code varchar(255) not null auto_increment,
- ubuntu13.10安装broadcom无线网卡驱动
- fedora优盘安装
- android 播放视频示例<转>
- 左右切换动画
- listview小demo
- H2和Hibernate:ERROR: org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful: create table
- 救济!!Oracle AP中文版User Guide
- m2eclipse+tomcat
- 理解类加载器和Class对象
- javascript面向对象设计
- Eclipse中的查询支持使用正则表达式
- 深入分析Java ClassLoader原理
- ASP.NET前台JS与后台CS函数如何互相调用
- 获取Class对象的三种方式