Hi! I am still new to Teneo and couldn't find anything usefull on the net. But people must have this problem too.
I want to unset (nullify) crossreferences of a model on delete.
With a xmi-resources this is easy
private void unsetCrossReferences(EObject model) {
Collection<Setting> find = EcoreUtil.UsageCrossReferencer.find(model, getEditingDomain().getResourceSet());
for(Setting setting : find) { setting.unset(); }
}
I found in the web that with teneo one should use the HbDataStore:
Object[]
HbDataStore hbDataStore
..
Object[] objects = hbDataStore.getCrossReferencers(getHibernateSession(), eObject);
This also works fine and i get all the referenced EObjects, but now i am stuck.
How do i unset/nullify the correct references in these eObjects?
Is there a way to get the "EStructuralFeature.Setting" from this EObjects to unset them?
Sure i could also manualy remove the references in the concrete objects but i am looking for a more generic way like the xmi - approach.
Is this possible and a correct approach? Does anybody now of some samples? This should be a common problem i think.
Thanks in advanced
and best regards weinma