These are chat archives for hibernate/hibernate-orm

15th
Mar 2017
BİLGE
@bilgeebilgin
Mar 15 2017 08:38
blob
@aucampia this is my goal ı wanna uptade last flag should be true, others should be false just as data insert database
ı solved problem with two hql guery first ı set all flag false others hql set last flag of id set true
BİLGE
@bilgeebilgin
Mar 15 2017 08:44
But in Postgresql ı wrote one query
update ration r1 set is_last_ration = not exists (select 1 from ration r2 where r2.id <> r1.id and r1.diet_program_id = r2.diet_program_id and r2.pet_ration_number > r1.pet_ration_number)