}
private void remapContainedAggregatedObject(final ObjectAdapter adapter, final RootOid persistedRootOid) {
for (final ObjectAssociation association: adapter.getSpecification().getAssociations(Contributed.EXCLUDED)) {
if (association.isOneToManyAssociation() && !association.isNotPersisted()) {
final ObjectAdapter collection = association.get(adapter);
final CollectionFacet facet = CollectionFacetUtils.getCollectionFacetFromSpec(collection);
for (final ObjectAdapter element : facet.iterable(collection)) {
remapAggregatedObject(element, persistedRootOid);
}
} else if (association.getSpecification().isParented()) {
final ObjectAdapter referencedAdapter = association.get(adapter);
if(referencedAdapter == null) {
continue;
}
remapAggregatedObject(referencedAdapter, persistedRootOid);