-
Nov 30th, 2011, 03:06 PM
#1
Why and how to avoid selects on associated entities while updating?
Hi guys,
When I use the saveAndFlush(myObject) method, I see queries that select the associated entities just before the update.
For instance I have a class User and a class Company, the user as a ManyToOne association with company.
Let's say I delete a company and just after I want to update the user with the company set to null (let's forget about database foreign keys or constraints for now), it breaks because the saveAndFlush(user) does a select to retrieve the company which doesn't exist anymore since I just deleted it.
Why those selects? How can I avoid them?
Thanks!
-
Dec 5th, 2011, 12:04 PM
#2
Anybody? Maybe someone from Spring?
-
Dec 12th, 2011, 09:36 AM
#3
Still waiting for an explanation...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules