Package commonj.sdo

Examples of commonj.sdo.DataGraph


   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetEDataGraph(DataGraph newEDataGraph, NotificationChain msgs)
  {
    DataGraph oldEDataGraph = eDataGraph;
    eDataGraph = newEDataGraph;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH, oldEDataGraph, newEDataGraph);
      if (msgs == null) msgs = notification; else msgs.add(notification);
View Full Code Here


   * @return the de-serialized data graph.
   * @throws IOException
   */
  public static DataGraph loadDataGraph(InputStream inputStream, Map options, TypeHelper scope) throws IOException
  {
    DataGraph result = null;
    if (scope == null || scope == TypeHelper.INSTANCE) {
      result = loadDataGraph(inputStream, options);
    } else if (options == null) {
      options = new HashMap();
      registerLoadingScope(options, scope);
View Full Code Here

      return target;
    }
   
    protected void writeDataObject(DataObject dataObject, ObjectOutput objectOutput) throws IOException
    {
      DataGraph dataGraph = dataObject.getDataGraph();
      if (dataGraph != null)
      {
        objectOutput.writeByte(0);
        objectOutput.writeUTF(DataObjectUtil.getXPath(dataObject));
        objectOutput.writeObject(dataGraph);
View Full Code Here

   

    Type newt = SDOUtil.createType(th, "testcases.changesummary", "simpleNOCS", false);
    Property strProp = SDOUtil.createProperty(newt, "strElem", strt);

    DataGraph graph = SDOUtil.createDataGraph();
    DataObject iNewt = graph.createRootObject(newt);
   
    testBasicsBody(strProp, iNewt);
}
View Full Code Here

  }



  public void testDynamicNestedDataObjectsDG() throws Exception {
    DataGraph dataGraph = SDOUtil.createDataGraph();
    DataObject quote = dataGraph.createRootObject(th.getType("http://www.example.com/simple", "Quote"));

    testDynamicNestedDOBody(quote);
   
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    SDOUtil.saveDataGraph(dataGraph, baos, null);
    // SDOUtil.saveDataGraph(dataGraph, System.out, null);
   
   assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(TEST_DATA)));

  
    assertEquals(1, quote.getList("quotes").size());
    assertEquals("fbnt", quote.getString("symbol"));
    dataGraph.getChangeSummary().undoChanges();
    // SDOUtil.saveDataGraph(dataGraph, System.out, null);
    assertEquals(0, quote.getList("quotes").size());
    assertNull(quote.getString("symbol"));
   
View Full Code Here

        List typesDefined = types.define(types2define);

        // Create an empty data graph and add a root object, an instance of customerType
        //

        DataGraph dataGraph = SDOUtil.createDataGraph();
        Type customerTypeDefined = (Type) typesDefined.get(1);
        DataObject customer1 = dataGraph.createRootObject(customerTypeDefined);

        customer1.setInt("custNum", 1);
        customer1.set("firstName", "John");
        customer1.set("lastName", "Adams");
        DataObject address = customer1.createDataObject("address");
        address.set("addrSt", "577 Airport Blvd");

        SDOUtil.registerDataGraphTypes(dataGraph, typesDefined);

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        SDOUtil.saveDataGraph(dataGraph, baos, null);
        //SDOUtil.saveDataGraph(dataGraph, System.out, null);

        byte[] serialized = baos.toByteArray();
        ByteArrayInputStream bais = new ByteArrayInputStream(serialized);
        DataGraph loadedDataGraph = SDOUtil.loadDataGraph(bais, null, SDOUtil.createTypeHelper());

        DataObject loadedRootObject = loadedDataGraph.getRootObject();
        assertNotSame(loadedRootObject.getType(), customer1.getType());

        // EqualityHelper requires same Type
        assertEquals(loadedRootObject.getInt("custNum"), customer1.getInt("custNum"));
        assertEquals(loadedRootObject.get("firstName"), customer1.get("firstName"));
View Full Code Here

              SDOUtil.setMany(property, true);
            }
        }

        // Create the DataGraph
        DataGraph g = SDOUtil.createDataGraph();

        // Create the root object
        g.createRootObject(rootType);

        ChangeSummary summary = g.getChangeSummary();
        summary.beginLogging();

        return g.getRootObject();
    }
View Full Code Here

        GraphBuilderMetadata gbmd = new GraphBuilderMetadata(results, configWrapper.getConfig(),
                resultSetShape);

        // Create the DataGraph
        DataGraph g = SDOUtil.createDataGraph();

        // Create the root object      
        g.createRootObject(gbmd.getRootType());

        SDOUtil.registerDataGraphTypes(g, gbmd.getDefinedTypes());
       
        ChangeSummary summary = g.getChangeSummary();

        ResultSetProcessor rsp = new ResultSetProcessor(g.getRootObject(), gbmd);
        rsp.processResults(getStartRow(), getEndRow());

        summary.beginLogging();

        return g.getRootObject();
    }
View Full Code Here

            }
        }
        _setDeleted(true);

        /** Order here is important - the dataGraph pointer should be cleared preorder before we enter the recursive loop to clear child DO's */
        DataGraph previousDataGraph = getDataGraph();
        // Remove back pointer to containing DataGraph
        setDataGraph(null);       

        List instancePropertiesList = getInstanceProperties();
        for (int i = 0, psize = instancePropertiesList.size(); i < psize; i++) {
View Full Code Here

            }
        }
        _setDeleted(true);

        /** Order here is important - the dataGraph pointer should be cleared preorder before we enter the recursive loop to clear child DO's */
        DataGraph previousDataGraph = getDataGraph();
        // Remove back pointer to containing DataGraph
        setDataGraph(null);

        List instancePropertiesList = getInstanceProperties();
        for (int i = 0, psize = instancePropertiesList.size(); i < psize; i++) {
View Full Code Here

TOP

Related Classes of commonj.sdo.DataGraph

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.