Spring JPA使用Goruby Clauzule选择列表对象
在我的数据库中,我有以下结构:Spring JPA使用Goruby Clauzule选择列表对象,spring,spring-data-jpa,jpql,Spring,Spring Data Jpa,Jpql,在我的数据库中,我有以下结构: ID NAME COUNT SOMETHING.. OWNER DATE 现在。我想为每个拥有者记录选择最大日期 没有GROUP BY clauzule,我的存储库看起来像: @Repository public interface MyRepo extends JpaRepository<MyEntity, Long> { MyEntity findTopByOrderByDateDesc(); } 目前还没有对Spring数据
ID NAME COUNT SOMETHING.. OWNER DATE
现在。我想为每个拥有者记录选择最大日期
没有GROUP BY clauzule,我的存储库看起来像:
@Repository
public interface MyRepo extends JpaRepository<MyEntity, Long> {
MyEntity findTopByOrderByDateDesc();
}
目前还没有对Spring数据的分组支持,因此它无法工作 如果需要,您必须编写自己的查询
org.springframework.data.mapping.PropertyReferenceException: No property groupByOwner found for type