Hi everyone,

I'd like to write some generic code to replace the set of related objects of a DataObject with a different set of objects. But I can't figure out how to get the list of the target objects.

Here's some naiive code to illustrate what I'd like to achieve:


final List<DataObject> oldObjects = (List<DataObject>) object.readProperty(name);

for (final DataObject targetObj : oldObjects) {
    object.removeToManyTarget(name, targetObj, true);
}

for (final DataObject targetObj : newObjects) {
    object.addToManyTarget(name, targetObj, true);
}


But apparently object.readProperty(…) doesn't return a list of the existing target objects.

What would be the correct way to do this?

Thanks a lot in advance!

-- Andreas


--
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01

Reply via email to