J
Jakub =?UTF-8?B?S3XFum1h?=
Hello,
I am newbie in Java and Hibernate. I need to translate the following
SQL query:
select t.*, v.capacity - sum(d.weight) as capacity
from transits t
join deliveries d on t.id = d.transitid
join vehicles v on t.vehicleid = v.id
group by t.id
having capacity >= :capacityMin
.... to Hibernate Query Language. I've tried with:
select t, v.capacity - sum(d.weight) as capacity
from Transit t
join t.deliveries d
join t.vehicle v
group by t.id
having capacity >= :capacityMin
But it doesn't work (no such column 'capacity'). Is there any other way
to do that?
Greetings and TIA.
I am newbie in Java and Hibernate. I need to translate the following
SQL query:
select t.*, v.capacity - sum(d.weight) as capacity
from transits t
join deliveries d on t.id = d.transitid
join vehicles v on t.vehicleid = v.id
group by t.id
having capacity >= :capacityMin
.... to Hibernate Query Language. I've tried with:
select t, v.capacity - sum(d.weight) as capacity
from Transit t
join t.deliveries d
join t.vehicle v
group by t.id
having capacity >= :capacityMin
But it doesn't work (no such column 'capacity'). Is there any other way
to do that?
Greetings and TIA.