SchemaManagementException----异常一只

来源:互联网 发布:文豆php培训学校 编辑:程序博客网 时间:2024/05/01 08:24
Exception in thread "main" java.lang.ExceptionInInitializerErrorCaused by: **org.hibernate.tool.schema.spi.SchemaManagementException**: Unable to execute schema management to JDBC target [create table order (order_id integer not null auto_increment, order_oid varchar(255), order_signString varchar(255), primary key (order_id))]    at org.hibernate.tool.schema.internal.TargetDatabaseImpl.accept(TargetDatabaseImpl.java:59)    at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlString(SchemaMigratorImpl.java:431)    at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlStrings(SchemaMigratorImpl.java:420)    at org.hibernate.tool.schema.internal.SchemaMigratorImpl.createTable(SchemaMigratorImpl.java:236)    at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigrationToTargets(SchemaMigratorImpl.java:167)    at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:60)    at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:133)    at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:101)    at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:470)    at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:708)    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:724)    at com.jiudianlianxian.utils.HibernateUtils.<clinit>(HibernateUtils.java:29)Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: 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 'order (order_id integer not null auto_increment, order_oid varchar(255), order_s' at line 1    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)    at com.mysql.jdbc.Connection.execSQL(Connection.java:3170)    at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1316)    at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1235)    at org.hibernate.tool.schema.internal.TargetDatabaseImpl.accept(TargetDatabaseImpl.java:56)    ... 12 more

这里写图片描述

在断断续续的一周折腾之后找到了不能建表的原因,表名问题,因为不知道这个表名有什么问题,所以猜测可能是与MySQL中默认表名产生冲突,导致建表失败。

原创粉丝点击