0
@Query("select new HiveHotelDateSummary(p.computeCategory, **case when 'CLUSTER'='CLUSTER' then p.clusterId else p.cityId end**,sum(p.addbackRooms),p.agreementTypeName,p.d) from HiveHotelDateSummary p where p.d>=:startDate  and p.d<=:endDate **group by p.computeCategory,case when 'CLUSTER'='CLUSTER' then p.clusterId else p.cityId end**,p.d,p.agreementTypeName")

When I am using the above query it works fine, but when I parametrized it doesn't work like in the below query.

select new HiveHotelDateSummary(p.computeCategory, case when :resourceType='CLUSTER' then p.clusterId else p.cityId end,sum(p.addbackRooms),p.agreementTypeName,p.d) from HiveHotelDateSummary p where p.d>=:startDate  and p.d<=:endDate group by p.computeCategory,case when :resourceType='CLUSTER' then p.clusterId else p.cityId end,p.d,p.agreementTypeName

anybody who can help me out?

Florian
  • 2,796
  • 1
  • 15
  • 25

0 Answers0