Package commonj.sdo

Examples of commonj.sdo.DataGraph


public final class DataObjectUtil
{
  public static Object writeReplace(DataObject dataObject) throws ObjectStreamException
  {
    DataGraph dataGraph = dataObject.getDataGraph();
    if (dataGraph != null)
    {
      return ((DataGraphImpl)dataGraph).getWriteReplacement((EObject)dataObject);
    }
    else
View Full Code Here


    return null;
  }
 
  public static ChangeSummary getChangeSummary(DataObject dataObject)
  {
    DataGraph dataGraph = getDataGraph(dataObject);
    if (dataGraph != null)
    {
      return dataGraph.getChangeSummary();
    }
    // TODO: handle ChangeSummary-type property
    return null;
  }
View Full Code Here

    }
  }
 
  public static Type getType(DataObject dataObject, String namespaceURI, String typeName)
  {
    DataGraph dataGraph = dataObject.getDataGraph();
    if (dataGraph != null)
    {
      return dataGraph.getType(namespaceURI, typeName);
    }
    else
    {
      //TODO think about where else to find the type
      return TypeHelper.INSTANCE.getType(namespaceURI, typeName);
View Full Code Here

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

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

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

        ChangeSummary summary = g.getChangeSummary();

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

        summary.beginLogging();

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

     */
    public void testChangeSummary() throws IOException {
        // Create an empty data graph and add a root object, an instance of type Quote
        //
     
        DataGraph dataGraph = SDOUtil.createDataGraph();
        DataObject quote = dataGraph.createRootObject("http://www.example.com/simple", "Quote");

        // Begin logging changes
        //
        ChangeSummary changeSummary = dataGraph.getChangeSummary();
        changeSummary.beginLogging();

        // Modify the data graph in various fun and interesting ways
        //
        quote.setString("symbol", "fbnt");
View Full Code Here

   * <!-- 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

   * <!-- end-user-doc -->
   * @generated NOT
   */
  public DataObject getRootObject()
  {
    DataGraph dataGraph = getDataGraph();
    if (dataGraph != null)
    {
      return dataGraph.getRootObject();
    }
    // TODO: handle ChangeSummary-type property
    return null;
  }
View Full Code Here

               "DataGraph datagraph = SDOUtil.loadDataGraph(\n"+
               "      ClassLoader.getSystemResourceAsStream(SampleInfrastructure.COMPANY_DATAGRAPH_XML), null);"

            );

            DataGraph datagraph = SDOUtil.loadDataGraph(ClassLoader.getSystemResourceAsStream(SampleInfrastructure.COMPANY_DATAGRAPH_XML), null);

            System.out.println(datagraph);

            commentary(
                "In this case we directly receive an instance of DataGraph and can retrieve the root\n"+
                "business object from the DataGraph\n\n"+
                "DataObject company = datagraph.getRootObject();");
           
            company = datagraph.getRootObject();
            System.out.println(company);           
            System.out.println();
                     
        } catch (Exception e) {
            somethingUnexpectedHasHappened(e);
View Full Code Here

      
        commentary (COMMENTARY_FOR_INTERMEDIATE,
            "Here is the use of the Tuscany API for creating a DataGraph instance\n\n"+
            "DataGraph dataGraph = SDOUtil.createDataGraph();");

        DataGraph dataGraph = SDOUtil.createDataGraph();
       
        commentary(COMMENTARY_FOR_INTERMEDIATE,
            "Now we create a root object of a selected type for the DataGraph wrapper to contain.\n"+
            "This is an example of a DataGraph interface that currently forces us to use the default scope.\n\n"+
            "company = dataGraph.createRootObject(SampleInfrastructure.COMPANY_NAMESPACE, \"CompanyType\");");
       
        DataObject company = dataGraph.createRootObject(SampleInfrastructure.COMPANY_NAMESPACE, "CompanyType");
       
        populateGraph(scope, company);
       
        commentary(COMMENTARY_FOR_INTERMEDIATE,
            "Since the SDO API doesn't currently have a method for serializing the DataGraph instance\n"+
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

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.