我将 JPA 与休眠一起使用。我想检查具有指定名称和用户名的行是否存在。以下查询引发错误:
@Query("select exists (select 1 from Strategy s where s.name=:name and s.username=:username)")
Boolean exists2(@Param("name") String name,@Param("username") String username);
错误:
Caused by: org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree [select exists (select s from com.soft.domain.strategy.Strategy s where s.name=:name and s.username=:username)]
有任何想法吗?