Package com.example.customer

Examples of com.example.customer.Customer


      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


    public void testChangeSummaryOnDataGraphWithInt() throws Exception {
     
      HelperContext hc = HelperProvider.getDefaultContext();
      CustomerFactory factory = CustomerFactory.INSTANCE;
      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();
View Full Code Here

TOP

Related Classes of com.example.customer.Customer

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.