我在HQL查询下运行,得到了[2015,2014]
select DISTINCT(YEAR(SP.deliveryDate)) from SupplyPlan as SP where SP.samplePlan=2
以上查询我需要在标准中,我尝试过如下,但它不起作用。有什么建议吗?
def supplyPlanCriteria=SupplyPlan.createCriteria()
def list=supplyPlanCriteria.list {
projections {
property("YEAR(deliveryDate)")
}
eq("samplePlan",samplePlan)
}