Hello list,

It looks like "myFirstObject.addToMyRelation(mySecondObject)" does not check if mySecondObject is already in the relationship. Is that correct?

If so, here is my problem.

I know that I can simply do:

mySecondObject.setTheObject(myFirstObject)

and then once saved, somehow the reverse relationship will be updated.

The problem is that I need the reverse relationship before I save. Therefore I do:

mySecondObject.setTheObject(myFirstObject)

and

myFirstObject.addToMyRelation(mySecondObject)

In order to have my object graph correct before save.

Unfortunately, doing this it seems like mySecondObject gets inserted twice in the List. If I restart the app, everything is fine again.

Thanks for any hint!

Alex

Reply via email to