Does EclipseLink support ORDER BY FIELD(field, :values)
问题 MySQL supports queries such as: SELECT id FROM users WHERE id IN(3,4,8,1) ORDER BY FIELD(id, 3,4,8,1); Does EclipseLink support this query (without reverting to a native query)? When I try the following: Select id from User user where user.id in :ids ORDER BY FIELD(user.id, :ids) I receive the error: Syntax error parsing the query ... line 1, column 98: unexpected token [(]. 回答1: ORDER BY FIELD(field, :values) is not supported by JPA (JQL) or EclipseLink. JPA does provide a mechanism to