werpu wrote:
I am just wondering on what the ideal way is to deal with such a situation.
I have an m:n mapping over a mapping table, which has extra attributes.
Dutyfully I mapped it to an m object a mapping object and an n object
so far so good.
Now I want to readjust the mapping at a certain stage of my program.
I now delete the associated mapping objects and reassign them.
Basically this works, but only in several cases.
Now to the problem, I am forced to use a compound key (project constraints)
now if I set the mapping to lazy,
deleting the objects via a deleta and reassigning them within the same session works.
Now if I turn off lazy, deleting them and reassigning them, results although a flush and clear was done in between, in an error, which basically says, that due to the cascade options a deleted object cannot be reassigned.
How is the ideal way to deal with this situation, for now I can live with lazy and doing it that way, but in the long run, I might be forced to set lazy to false and to run into the problem.
Aha... I've found your post! (It's josh from the MyFaces list)
If I understand you correctly, you are trying to delete objects and then re-point them at each other, correct?
If that's the case then it would make sense if it worked when lazy is 'true' because the objects being re-assigned are actually *proxy* objects, and the session needs to keep track of those slightly differently.
I could probably give you a better answer if you posted an example. :)