Hibernate Update query from multiple tables.
Posted on 2010-08-22
I have the following sql Query which works perfectly fine. How do I write the same in Hibernate. I would be happy if you could give an example for three tables Ex: A, B and C where update a.name set a.name="myname" where A.col1=B.col3 and B.col2=C.col1 and a.age ='20'
UPDATE (select P.cart_item as New_Cart_Item , C.cart_item as Old_Cart_Item
from prices P, carts C
where P.cart_item = C.cart_item
and BLAH BLAH BLAH )
set Old_Cart_Item = New_Cart_Item