由另一个实体分组

时间:2018-11-06 16:37:30

标签: java hibernate spring-boot

我正在尝试

 @Query(value = "select client, sum(price) from PizzaOrder group by client")
 public List<?> topClients();

PizzaOrder 包含以下字段:

private Double price;

@ManyToOne
private Client client;

Client 类还定义了equals和hashCode。

错误:

Validation failed for query for method public abstract java.util.List packageName.PizzaOrderRepository.topClients()

1 个答案:

答案 0 :(得分:0)

该查询应类似于:

dim3 block_size, grid_size;
unsigned int smem_size;

block_size.x = 10;
block_size.y = 10;
block_size.z = 2;

// smem_size is depandant on ThreadBlock size.
smem_size = (block_size.x * block_size.y * block_size.z) * 5; 

myCudaKernel<<< grid_size, block_size, smem_size >>>(...);

请参见this HQL docs