using Hibernate, I would like to update the data in the database based on conditions, but I got the following error: "node to move cannot be null"
Here is my database description:
Account: id, email, password
Member : id, account, team
Team: id, current (and a reference to member => members)
Here is my JPA:
UPDATE Team t SET t.current = :current LEFT JOIN t.members m WHERE t.current = :current_true AND m.account = :account
What am I doing wrong? If I move the LEFT JOIN to SET:
UPDATE Team t LEFT JOIN t.members m SET t.current = :current WHERE t.current = :current_true AND m.account = :account
I got: "waiting for SET, found LEFT"
If I remove the connection:
UPDATE Team t SET t.current = :current WHERE t.current = :current_true AND t.members.account = :account
I got: "An illegal attempt to dereference a collection."
What is the correct way to update values?
Thank you for your help!
source
share