1. 程式人生 > >Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Unable to execute schema manag

Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Unable to execute schema manag

這裡通過  spring jpa 設計資料的時候,處理問題,問題如下


Caused by: org.hibernate.tool.schema.spi.SchemaManagementException:
Unable to execute schema management to JDBC target

[create table order (id integer not null, order_time datetime, shop_id integer not null auto_increment, customer_id integer not null, car_id integer not null, primary key (shop_id, id, customer_id, car_id))]

Caused by: com.mysql.jdbc.exceptions.jdbc4.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 (id integer not null, order_time datetime, shop_id integer not null auto_i' at line 1




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 (id integer not null, orderTime datetime, car_id integer, customer_id inte' at line 1

看一下,可能資料哭的版本問題,或者是建立表的結構有問題,但是,一般人,都會先懷疑,是自己的pojo 對映表出現問題,

後來,測試,最簡單的pojo還是有問題,於是,就懷疑是資料庫的版本有問題,於是,我換了一個pojo的類名稱,ok,搞定

之前,使用的是Order   ,後來,改為 Item ,可能是資料庫,把這個作為,一個系統的檔案,不讓改.所以....