在创建entity的时候要注意entity的名字是否是对应的db的保留字
现在的开发中用到了lock这个entity,在persistence的时候出现错误:
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 ‘Lock (lockOwner_UU
ID, version_UUID, UUID) values (’ff808181211ae76901211ae76c2c0′ at line 1
因为lock是mysql的保留字。
mysql的所有保留字可以在下面的网页里查到
http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html
JPA create sql error
最新推荐文章于 2024-04-25 14:57:05 发布