Package commonj.sdo

Examples of commonj.sdo.DataGraph


            }
        }
        _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


            SDOUtil.setContainment(property, true);
            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

                  editingDomain.getResourceSet().getResources().addAll(
                          dataGraph.getResourceSet().getResources());
                  dataGraph.setResourceSet(editingDomain.getResourceSet());
              } else {
                  Resource resource = editingDomain.loadResource(uri.toString());
                  DataGraph dataGraph = (DataGraph) resource.getContents().get(0);
                  sharedDataGraph = EditorPlugin.getDefault().publish(path,
                          dataGraph, new UpdateConsumer());
              }
            } else super.createModel();
        } catch (ECFException e) {
View Full Code Here

     
      HelperContext hc = HelperProvider.getDefaultContext();
      CustomerFactory.INSTANCE.register(hc);   
     
      Type customerType = hc.getTypeHelper().getType(Customer.class);  
      DataGraph dataGraph = SDOUtil.createDataGraph();
      Customer customer = (Customer) dataGraph.createRootObject(customerType);
   
      Account account = CustomerFactory.INSTANCE.createAccount();
      customer.setAccount(account);
      customer.setFirstName("John");
      customer.getAccount().setAccountNum(1234);
       
      ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
      SDOUtil.saveDataGraph(dataGraph, outputStream, null);
      DataGraph loadDataGraph = SDOUtil.loadDataGraph(new ByteArrayInputStream(outputStream.toByteArray()), null);
     
      loadDataGraph.getChangeSummary().beginLogging();
     
      customer = (Customer) loadDataGraph.getRootObject();
      customer.getAccount().setAccountNum(987);  
     
      loadDataGraph.getChangeSummary().endLogging();
     
      List changedDataObjects = loadDataGraph.getChangeSummary().getChangedDataObjects();  
        assertEquals("in fact 1 Object was changed in the code", 1, changedDataObjects.size());    
    }
View Full Code Here

      factory.register(hc);
      Customer customer = factory.createCustomer();
      Account account = factory.createAccount();
      customer.setAccount(account);
      DataObject customerDO = (DataObject) customer;
      DataGraph dg = SDOUtil.createDataGraph();
      SDOUtil.setRootObject(dg, customerDO);
      dg.getChangeSummary().beginLogging();
      dg.getRootObject().getDataObject(0).delete();
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      SDOUtil.saveDataGraph(dg, baos, null);
    }
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(SDOUtil.getXPath(dataObject));
        objectOutput.writeObject(dataGraph);
View Full Code Here

    return null;
  }
 
  public static ChangeSummary getChangeSummary(DataObject dataObject)
  {
    DataGraph dataGraph = getDataGraph(dataObject);
    if (dataGraph != null)
    {
      return dataGraph.getChangeSummary();
    }
    else
    {
      for (DataObject csDataObject = dataObject; csDataObject != null; csDataObject = csDataObject.getContainer())
      {
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.