我正在使用Spring數據jpa 1.2,並且無法找到像以下這樣的聚合查詢結果。如何使用spring-data-jpa檢索聚合函數查詢
select count(v), date(v.createTimestamp) from UserEntity v
group by date(v.createTimestamp)
與原生JPA完美地工作
@Entity()
public class UserEntity {
@Id
private long id;
.
.
@Column(columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
private Timestamp createTimestamp;
}
任我JPA庫是
public interface UserRepository extends JpaRepository<UserEntity, Long>,
JpaSpecificationExecutor<UserEntity> {
}
所以我怎麼可以做一個彙總查詢扔春季數據,我發現一無所有文檔
您列表中的第二實際上已經被更新以反映從春季數據1.7開始,countby謂詞已被添加 – chrismarx 2015-07-21 15:47:00