Hi!
At parent/children pattern, parent know children, but child don't know parent. I want to update a parent's children. I wrote below DML-style update statement:
update children c set c.name='test' where c.id in (select c.id from parent p join p.children c where p.name='parent');
It was translated as below mysql statement:
update children set name='test' where id in (select c.id from parent p inner join children c on p.id=c.parentid where p.name='parent');
But exception throwed when running. It is:
You can't specify target table 'children' for update in FROM clause.
I must do it using DML-style update because performence reason. How can I do?
Thanks very much!
|