Package commonj.sdo

Examples of commonj.sdo.Sequence


    if (javaClassFeature == null)
    {
      javaClassFeature = BasicExtendedMetaData.INSTANCE.getAttribute("commonj.sdo/java", "javaClass");
    }

    Sequence anyAttribute = getAnyAttribute();
    int count = anyAttribute.size();
    for (int i = 0; i < count; i++)
    {
      EStructuralFeature eFeature = (EStructuralFeature)anyAttribute.getProperty(i);
      if (eFeature == javaClassFeature)
      {
        return (String)anyAttribute.getValue(i);
      }
    }
    return null;
  }
View Full Code Here


   
    DataObject quote = factory.create("http://www.example.com/mixed", "MixedQuote");

    assertTrue(quote.getType().isSequenced());
   
    Sequence sequence = quote.getSequence();

    sequence.addText("\n  ");

    quote.setString("symbol", "fbnt");

    sequence.addText("\n  ");

    quote.setString("companyName", "FlyByNightTechnology");

    sequence.addText("\n  some text\n  ");

    DataObject child = quote.createDataObject("quotes");
    child.setBigDecimal("price", new BigDecimal("2000.0"));

    sequence.addText("\n  more text\n  ");

    // quote.setBigDecimal("price", new BigDecimal("1000.0"));
    sequence.add("price", new BigDecimal("1000.0"));

    sequence.addText("\n");

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    xmlHelper.save(quote, "http://www.example.com/mixed", "mixedStockQuote", baos);
    assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(MIXED_XML)));
  }
View Full Code Here

   
    DataObject quote = factory.create("http://www.example.com/mixed", "MixedOpenQuote");

    assertTrue(quote.getType().isSequenced());
   
    Sequence sequence = quote.getSequence();

    sequence.addText("\n  ");

    Type definedGlobalType = types.getType("http://www.example.com/open", "DocumentRoot");
   
    Property definedSymbolProperty = definedGlobalType.getProperty("symbol");
    quote.setString(definedSymbolProperty, "fbnt");

    sequence.addText("\n  ");

    quote.setString("companyName", "FlyByNightTechnology");

    sequence.addText("\n  some text\n  ");

    DataObject child = quote.createDataObject("quotes");
    child.setBigDecimal("price", new BigDecimal("2000.0"));

    sequence.addText("\n  more text\n  ");

    // quote.setBigDecimal("price", new BigDecimal("1000.0"));
    sequence.add("price", new BigDecimal("1000.0"));

    sequence.addText("\n");

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    xmlHelper.save(quote, "http://www.example.com/mixed", "mixedOpenStockQuote", baos);
    assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(MIXEDOPEN_XML)));
  }
View Full Code Here

     * @param dataObj3
     */
    private void sequenceSingleValueOneMember(DataObject dataObj1) {
        assertTrue("DataObject is not Sequenced.  Test case may not proceed.", dataObj1.getType().isSequenced());
       
        Sequence sequence = dataObj1.getSequence();

        sequence.add("Contain", dataObj1);
    }
View Full Code Here

     * @param dataObj3
     */
    private void sequenceSingleValueNMember(DataObject dataObj1, DataObject dataObj2, DataObject dataObj3) {
        assertTrue("DataObject is not Sequenced.  Test case may not proceed.", dataObj1.getType().isSequenced());

        Sequence sequence1 = dataObj1.getSequence();
        Sequence sequence2 = dataObj2.getSequence();
        Sequence sequence3 = dataObj3.getSequence();

        sequence1.add("Contain", (Object) dataObj2);
        sequence2.add("Contain", (Object) dataObj3);

        sequence3.add("Contain", (Object) dataObj1);
    }
View Full Code Here

     * @param dataObj3
     */
    private void sequenceMultiValueOneMember(DataObject dataObj1, DataObject dataObj2, DataObject dataObj3) {
        assertTrue("DataObject is not Sequenced.  Test case may not proceed.", dataObj1.getType().isSequenced());

        Sequence sequence = dataObj1.getSequence();
       
        sequence.add("ContainMany", dataObj2);
        sequence.add("ContainMany", dataObj3);
        sequence.add("ContainMany", dataObj1);
    }
View Full Code Here

       
        addList.clear();
        addList.add(dataObj3);
        dataObj2.setList("ContainMany", addList);

        Sequence sequence = dataObj3.getSequence();

        sequence.add("ContainMany", dataObj1);
    }
View Full Code Here

            if (convertValue) {
              value =  DataHelper.INSTANCE.convert(lastProperty.getType(), value);
            }
           
            Sequence seq = lastDataObject.getSequence();
            if (seq != null) {
                seq.setValue(numInLastProperty, value);
            } else {
                objects.set(numInLastProperty, value);
            }
        }
    }
View Full Code Here

        // swap sequences (may be UC2(DataObject and sequence change) or UC4 (sequence change only)
        if (getType().isSequenced()) {// assume sequence is !null
            // perform sequence.isDirty check independent of a dataObject.isDirty check
            if (((SDOChangeSummary)cs).isDirty((SDOSequence)sequence)) {
                Sequence currentSequence = sequence;
                Sequence originalSequence = (Sequence)((SDOChangeSummary)cs).getOriginalSequences().get(this);

                // both sequences are either null or set
                if ((null == originalSequence) && (null != currentSequence)) {
                    throw SDOException.oldSequenceNotFound();
                } else {
View Full Code Here

                                            nextCS.pauseLogging();
                                            boolean wasSet = nextModifiedDO.isSet(nextProp);

                                            Object existingValue = nextModifiedDO.get(nextProp);
                                            // grab index of nextProp's Setting for use during setting below
                                            Sequence nextModifiedDOSequence = nextModifiedDO.getSequence();
                                            int settingIdx = -1;
                                            if (nextModifiedDOSequence != null) {
                                                settingIdx = ((SDOSequence)nextModifiedDOSequence).getIndexForProperty(nextProp);
                                            }
                                            value._setContainmentPropertyName(null);
View Full Code Here

TOP

Related Classes of commonj.sdo.Sequence

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.