MYSQL的排序策略不起作用
我在实体中定义了一个ID:
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
在保留实体时,出现以下错误。我检查了一些提示,但没有人为我工作。
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.0.v20170811-d680af5): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: 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 'OPTION SQL_SELECT_LIMIT=DEFAULT' at line 1
Error Code: 1064
Call: UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?
bind => [2 parameters bound]
Query: DataModifyQuery(name="SEQUENCE" sql="UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?")
MYSQL版本:8
可以从工作台执行SQL“ UPDATE SEQUENCE ...”,而不会出现问题。 “ OPTION SQL_SELECT_LIMIT = DEFAULT”似乎无效。由于顺序策略,我猜想在调用.persist()时隐式出现“ OPTION SQL_SELECT_LIMIT = DEFAULT”。
有任何帮助提示吗?
UPDATE
切换到 策略= GenerationType.IDENTITY 不会调用“ OPTION SQL_SELECT_LIMIT = DEFAULT”,效果很好。奇怪。