在使用hibernate开发时,我们避免也会出现过在@query注解中手写sql,在使用"LIMIT"的时候会出现下面错误,
Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: LIMIT near line 1,
解决:
加上nativeQuery=true
@Query(value = “”,nativeQuery=true)
在使用hibernate开发时,我们避免也会出现过在@query注解中手写sql,在使用"LIMIT"的时候会出现下面错误,
Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: LIMIT near line 1,
解决:
加上nativeQuery=true
@Query(value = “”,nativeQuery=true)