AbstractClassMetaData relCmd = nucCtx.getMetaDataManager().getMetaDataForClass(mmd.getTypeName(), clr);
String relKindName = EntityUtils.getKindName(storeMgr.getIdentifierFactory(), relCmd);
Query q2 = new Query(relKindName, entity.getKey());
PreparedQuery pq2 = datastore.prepare(q2);
Object value = null;
for (Entity childEntity : pq2.asIterable()) { // Should be only one (see FetchFieldManager)
if (entity.getKey().equals(childEntity.getKey().getParent())) {
value = childEntity.getKey();
break;
}
}