on 03-17-2006 10:55 AM
Hi, all!
By now if I want to remove all the model objects from a context model node which I previously added with .add, I loop over the node removing each model object.
Is there probably a more convenient one method call which gets me rid of those model objects?
Regards,
Thomas
Thomas,
Yes and no.
"Yes" for creatin scenarios with Adaptive RFC and ESF models. "No" for WebService & JavaBean model.
For scenarios that it works, you have to get some collection of related objects you whant to remove, and then clear it:
final <YourParentModelClass> object
= wdContext
.current<YourNodeName>Element()
.modelObject();
final Collection related
= object.get<RelationName>();
related.clear();
This will have some neat side effect, that if your relation was mapped to child node, then child node will reflect changes automatically.
However, with ESF model for certain relations this will cause persistent objects on back-end to be deleted with module.commit() call. So use code above with care for this type of model.
Valery Silaev
EPAM Systems
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.