This question is in two parts, first part is about clearing a list and second part is about assigning an owner to an object.
I have a one-to-many relationship between tw
For #1 you can clear the collection (it's a Set by default):
activePerson.locations.clear()
For #2 use addToLocations:
activePerson.addToLocations(location)
and when you save the person the location<->person relationship will be updated.