Daniel, You need to use SDOUtil.loadDataGraph() to load the xml. Take a look at ObtainingDataGraphFromXml in the sdo-samples project.
Frank. Fuhwei Lwo <[EMAIL PROTECTED]> wrote on 05/09/2007 02:32:21 AM: > Hi Daniel, > > According to SDO 2.1 spec, a data object tree does not necessarily > need to have a data graph object. Below is the javadoc for > getDataGraph() from DataObject.java. > > /** > * Returns the [EMAIL PROTECTED] DataGraph data graph} for this object or > <code>null</code> if there isn't one. > * @return the containing data graph or <code>null</code>. > */ > DataGraph getDataGraph(); > > In your case, the chance is that the file you are loading didn't > contain a data graph. Can you verify it? If there was a data graph > and the problem existed, please open a JIRA with your test case so I > can take a look. Thanks. > > Fuhwei Lwo > > Daniel Savoie <[EMAIL PROTECTED]> wrote: Are there general issues > accessing DataGraph/ChangeSummary for SDO2? I > don't seem to be able to get access to either using M2 or M3. > > I can create DataObjects for SDOs I had used previously without a problem > (used with SDO1). I can also load the sample DataObject XSD outlined in > the SDO2 spec (company.xsd) - which includes a change summary instance and > a company instance. > > What I can't do is get anything but null from getDataGraph() or > getChangeSummary(): > > XMLHelper.INSTANCE.load(FileInputStream); // input stream is > valid, load works > DataObject companyDG = doc.getRootObject(); // root > object is returned > OR > DataObject companyDG = DataFactory.INSTANCE.create(ns, type); // > data object object is returned > ... > DataGraph newdg = companyDG.getDataGraph(); // always > null > ChangeSummary cs = companyDG.getChangeSummary(); // > always null > > Should I inherently be able to get DG/CS references (not null) once I've > defined a DataObject? Is there something else I need to do? > > Regards, > Dan Savoie > > IBM WebSphere Adapter Development > 1-919-543-9026 (T/L: 441-9026) > [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]