PrimaryObject primaryObject = ModelFactory.eINSTANCE.createPrimaryObject();
primaryObject.setName("junit");
{
TargetObject targetObject = ModelFactory.eINSTANCE.createTargetObject();
targetObject.setSingleAttribute("one");
saveObject(resourceSet, targetObject);
primaryObject.setSingleContainmentReferenceProxies(targetObject);
targetObject.eResource().unload();
}
{
TargetObject targetObject = ModelFactory.eINSTANCE.createTargetObject();
targetObject.setSingleAttribute("one");
saveObject(resourceSet, targetObject);
primaryObject.setSingleNonContainmentReference(targetObject);
targetObject.eResource().unload();
}
{
TargetObject targetObject = ModelFactory.eINSTANCE.createTargetObject();
targetObject.setSingleAttribute("one");
saveObject(resourceSet, targetObject);
primaryObject.getMultipleContainmentReferenceProxies().add(targetObject);
targetObject.eResource().unload();
}
{
TargetObject targetObject = ModelFactory.eINSTANCE.createTargetObject();
targetObject.setSingleAttribute("one");
saveObject(resourceSet, targetObject);
primaryObject.getMultipleNonContainmentReference().add(targetObject);
targetObject.eResource().unload();
}
{
PrimaryObject targetObject = ModelFactory.eINSTANCE.createPrimaryObject();
targetObject.setName("target");
saveObject(targetObject);
primaryObject.setContainmentReferenceSameCollectioin(targetObject);
targetObject.eResource().unload();
}
saveObject(resourceSet, primaryObject);
// Verify that proxies aren't resolved as a result of saving to Mongo DB.