When I am calling rejectChanges() on an entity that has a non-scalar property that is a complex type it appears it is deleting all of those complex types -
metadataStore.addEntityType({
shortName: "GrandParent",
namespace: "Product",
dataProperties: {
id: { dataType: "String", isPartOfKey: true },
someValues: { complexTypeName: "parentValue:#Product", isScalar: false }
}
});
metadataStore.addEntityType({
shortName: "ParentValue",
namespace: "Product",
isComplexType: true,
dataProperties: {
id: { dataType: "String" },
text: { dataType: "String" },
previousValue: { complexTypeName: "ChildValue:#Product", isScalar: true }
}
});
metadataStore.addEntityType({
shortName: "ChildValue",
namespace: "Product",
isComplexType: true,
dataProperties: {
value: { dataType: "String" },
text: { dataType: "String" }
}
});
I previously had the issue where adding complexTypes to the array and calling cancelChanges was doubling the complexTypes in the list - I can requery the server for the items for now but it appears to be somewhat related