}
//
// else, handle aggregate
//
AggregatedOid aggregatedOid = (AggregatedOid) typedOid;
final TypedOid parentOid = aggregatedOid.getParentOid();
//final ObjectAdapter parentAdapter = objectMapping.mappedObject(idParts[0] + "@" + idParts[1]);
final ObjectAdapter parentAdapter = objectMapping.mappedObject(parentOid.enString(getOidMarshaller()));
getPersistenceSession().resolveImmediately(parentAdapter);
//ObjectSpecId objectType = null;
//final AggregatedOid aggregatedOid = new AggregatedOid(objectType, (TypedOid) parentAdapter.getOid(), idParts[2]);
ObjectAdapter aggregatedAdapter = null;
outer: for (final ObjectAssociation association : parentAdapter.getSpecification().getAssociations(Contributed.EXCLUDED)) {
if (association.getSpecification().isParented()) {
final ObjectAdapter objectAdapter = association.get(parentAdapter);
if (objectAdapter == null) {
continue;
}
if (association.isOneToManyAssociation()) {
final ObjectAdapter coll = objectAdapter;
final CollectionFacet facet = coll.getSpecification().getFacet(CollectionFacet.class);
for (final ObjectAdapter element : facet.iterable(coll)) {
if (element.getOid().equals(aggregatedOid)) {
aggregatedAdapter = element;
break outer;
}
}
} else {
if (objectAdapter.getOid().equals(aggregatedOid)) {
aggregatedAdapter = objectAdapter;
break;
}
}
} else if (association.isOneToManyAssociation()) {
if (association.getId().equals(aggregatedOid.getLocalId())) {
//if (association.getId().equals(idParts[2])) {
return association.get(parentAdapter);
}
}
}