我有以下代码:
@Query("SELECT u FROM User u WHERE u.party.id = :id")
List<User> findUsersByPartyId(@Param("id") Long id);
在日志中我看到:
org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.SQLServer2008Dialect
然后错误:
com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'user'.
我尝试用[](SELECT u FROM [User]...
)包装它但在这种情况下我看到错误:
org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: [ near line 1, column 15 [SELECT u FROM [User] u WHERE u.party.id = :id]
如果我无法重命名表格,如何修复它?