Hi people,
I would appreciate if you could bring some light to my darkness regarding
the following:
After creating an XSD i generated corresponding interfaces and tried to see
the Changesummary working.
My assumption is the changesummary will give me changed Properties within
the DataObjects of a DataGraph.
So I did the following:
1. Created the datagraph + Created a rootObject + added another Object to
the Root Object
2. stored and loaded the datagraph
3. turned on logging for the graph
4. changed a property of a DataObject from the graph
5. expected a changed dataobject in the summary, but did not get one.
Am I missunderstanding how Changesummary works?
Thanks for your help
Steffen
please see my code below
DataGraph myGraph = SDOUtil.createDataGraph();
HelperContext hc = SDOUtil.createHelperContext();
// Creating a sample Datagraph, with a Container having a List of
Vocables
Type containerType = hc.getTypeHelper().getType(Container.class );
Container container = (Container) myGraph.createRootObject
(containerType);
Vocable vocable = SdoFactoryImpl.init().createVocable();
vocable.setVocableID(123123);
container.getVocables().add(vocable);
// Storing and loading it
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
SDOUtil.saveDataGraph(myGraph, outputStream, null);
System.out.println(new String(outputStream.toByteArray()));
DataGraph loadGraph = SDOUtil.loadDataGraph(new
ByteArrayInputStream(outputStream.toByteArray()), null);
// turn on logging
loadGraph.getChangeSummary().beginLogging();
// Making changes
Container loadedContainer = (Container) loadGraph.getRootObject();
Vocable voc = (Vocable) loadedContainer.getVocables().get(0);
voc.setVocableID(1312);
loadGraph.getChangeSummary().endLogging();
List changedDataObjects = loadGraph.getChangeSummary
().getChangedDataObjects();
// prints out 0 :-(
System.out.println("Size of changedObjects after changing a
property:" + changedDataObjects.size());