Examples of MappingElement


Examples of org.teiid.query.mapping.xml.MappingElement

    }


    private static MappingNode createTestAttributePlan() {
        MappingDocument doc = new MappingDocument(true);
        MappingElement root = doc.addChildElement(new MappingElement("FixedValueTest")); //$NON-NLS-1$
       
        //sequence
        MappingSequenceNode seq = root.addSequenceNode(new MappingSequenceNode());      
       
        MappingElement wrapper = seq.addChildElement(new MappingElement("wrapper")); //$NON-NLS-1$
        wrapper.setSource("xmltest.group.items"); //$NON-NLS-1$
        wrapper.setMaxOccurrs(-1);
        MappingAttribute att = new MappingAttribute("fixedAttr"); //$NON-NLS-1$
        att.setValue("fixed attribute"); //$NON-NLS-1$
        wrapper.addAttribute(att);
       
        //sequence
        MappingSequenceNode seq1 = wrapper.addSequenceNode(new MappingSequenceNode());
        seq1.addChildElement(new MappingElement("key","xmltest.group.items.itemNum")); //$NON-NLS-1$ //$NON-NLS-2$
        seq1.addChildElement(new MappingElement("fixed")) //$NON-NLS-1$
            .setValue("fixed value"); //$NON-NLS-1$
       
        return doc;
    }
View Full Code Here

Examples of org.teiid.query.mapping.xml.MappingElement

        return doc;
    }

    private static Object createUpdateTestDoc() {
        MappingDocument doc = new MappingDocument(true);
        MappingElement root = doc.addChildElement(new MappingElement("UpdateTest")); //$NON-NLS-1$
       
        MappingSequenceNode seq = root.addSequenceNode(new MappingSequenceNode());
        seq.setSource("xmltest.updateTest"); //$NON-NLS-1$
        seq.addChildElement(new MappingElement("data", "xmltest.updateTest.rowCount")); //$NON-NLS-1$ //$NON-NLS-2$       
        return doc;
    }
View Full Code Here

Examples of org.teiid.query.mapping.xml.MappingElement

        return doc;
    }

    private static MappingNode createXMLPlanWithComment(){
        MappingDocument doc = new MappingDocument(true);
        MappingElement root = doc.addChildElement(new MappingElement("Root")); //$NON-NLS-1$
       
        root.addCommentNode(new MappingCommentNode("Comment1")); //$NON-NLS-1$
        MappingElement node = root.addChildElement(new MappingElement("Something")); //$NON-NLS-1$
        node.addCommentNode(new MappingCommentNode("Comment2")); //$NON-NLS-1$
        return doc;
    }
View Full Code Here

Examples of org.teiid.query.mapping.xml.MappingElement

        return doc;
    }

    public static MappingDocument createXMLMappingBoundingNode() {
        MappingDocument doc = new MappingDocument(true);
        MappingElement root = doc.addChildElement(new MappingElement("Catalogs"));//$NON-NLS-1$
        MappingElement cat = root.addChildElement(new MappingElement("Catalog")); //$NON-NLS-1$
        MappingElement items = cat.addChildElement(new MappingElement("Items")); //$NON-NLS-1$
      
        MappingElement item = items.addChildElement(new MappingElement("Item")); //$NON-NLS-1$
        item.setSource("xmltest.group.items"); //$NON-NLS-1$
        item.setMinOccurrs(1);
        item.setMaxOccurrs(2);
       
        item.addAttribute(new MappingAttribute("ItemID", "xmltest.group.items.itemNum")); //$NON-NLS-1$ //$NON-NLS-2$
        item.addChildElement(new MappingElement("Name", "xmltest.group.items.itemName").setNillable(true)); //$NON-NLS-1$ //$NON-NLS-2$
        item.addChildElement(new MappingElement("Quantity", "xmltest.group.items.itemQuantity")); //$NON-NLS-1$ //$NON-NLS-2$       
        return doc;
    }
View Full Code Here

Examples of org.teiid.query.mapping.xml.MappingElement

    private static MappingNode createXMLPlanSOAP() {

        Namespace namespace = new Namespace("ORG", "http://www.mm.org/dummy"); //$NON-NLS-1$ //$NON-NLS-2$

        MappingDocument doc = new MappingDocument(true);
        MappingElement root = doc.addChildElement(new MappingElement("TaxReports", namespace)); //$NON-NLS-1$
       
        root.setNamespaces(new Namespace[] {namespace});
       
        MappingElement report = root.addChildElement(new MappingElement("TaxReport", namespace)); //$NON-NLS-1$
        report.setNamespaces(new Namespace[] {namespace});
              
        Namespace xsiNamespace = new Namespace("xsi", "http://www.w3.org/2001/XMLSchema-instance"); //$NON-NLS-1$ //$NON-NLS-2$
        Namespace soapNamespace = new Namespace("SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/"); //$NON-NLS-1$ //$NON-NLS-2$
       
        MappingElement taxIds = report.addChildElement(new MappingElement("ArrayOfTaxID", namespace)); //$NON-NLS-1$
        taxIds.setMinOccurrs(0);
        taxIds.setNamespaces(new Namespace[] {xsiNamespace, soapNamespace});
       
        MappingAttribute xsiType = new MappingAttribute("type", xsiNamespace); //$NON-NLS-1$
        xsiType.setValue(namespace.getPrefix()+":ArrayOfTaxIDType"); //$NON-NLS-1$       
        xsiType.setOptional(true);
        taxIds.addAttribute(xsiType);
       
        MappingAttribute arrayType = new MappingAttribute("arrayType", soapNamespace); //$NON-NLS-1$
        arrayType.setValue( namespace.getPrefix()+":TaxIDType[]"); //$NON-NLS-1$
        arrayType.setOptional(true);
        taxIds.addAttribute(arrayType);
         
        MappingElement taxId = taxIds.addChildElement(new MappingElement("TaxID", namespace)); //$NON-NLS-1$
        taxId.setSource("xmltest.group.TaxIDs"); //$NON-NLS-1$
        taxId.setMaxOccurrs(-1);
        MappingAttribute xsiType2 = new MappingAttribute("type", xsiNamespace); //$NON-NLS-1$
        xsiType2.setValue(namespace.getPrefix()+":TaxIDType"); //$NON-NLS-1$
        xsiType2.setOptional(true);
        taxId.addAttribute(xsiType2);

        taxId.addChildElement(new MappingElement("ID", "xmltest.group.TaxIDs.ID")); //$NON-NLS-1$ //$NON-NLS-2$
        return doc;
    }   
View Full Code Here

Examples of org.teiid.query.mapping.xml.MappingElement

        return doc;
    }
   
    private static MappingNode createChoiceDefect24651() {
        MappingDocument doc = new MappingDocument(true);
        MappingElement root = doc.addChildElement(new MappingElement("root")); //$NON-NLS-1$

        MappingChoiceNode choice = root.addChoiceNode(new MappingChoiceNode(false));
        choice.setSource("xqttest.data7"); //$NON-NLS-1$
        choice.setMaxOccurrs(-1);
        MappingCriteriaNode crit = choice.addCriteriaNode(new MappingCriteriaNode("xqttest.data7.intKey < 10", false)); //$NON-NLS-1$
        MappingElement wrapper1 = crit.addChildElement(new MappingElement("wrapper")); //$NON-NLS-1$

        MappingElement key = wrapper1.addChildElement(new MappingElement("key", "xqttest.data7.intKey")); //$NON-NLS-1$ //$NON-NLS-2$
        key.setExclude(true);
               
        return doc;
    }
View Full Code Here

Examples of org.teiid.query.mapping.xml.MappingElement

     * Method createXQTPlanRecursive.
     * @return Object
     */
    private static MappingNode createXQTPlanRecursive_5988() {
        MappingDocument doc = new MappingDocument(true);
        MappingElement root = doc.addChildElement(new MappingElement("recursiveTest")); //$NON-NLS-1$
       
        MappingElement src1 = root.addChildElement(new MappingElement("src")); //$NON-NLS-1$
        src1.setSource("xqttest.data"); //$NON-NLS-1$
       
        MappingSequenceNode seq1 = new MappingSequenceNode();
        seq1.addChildElement(new MappingElement("key", "xqttest.data.intKey")); //$NON-NLS-1$ //$NON-NLS-2$
        seq1.addChildElement(new MappingElement("data", "xqttest.data.intNum")); //$NON-NLS-1$ //$NON-NLS-2$
        src1.addSequenceNode(seq1);

        MappingElement src2 = seq1.addChildElement(new MappingElement("srcNested")); //$NON-NLS-1$
        src2.setSource("xqttest.data2"); //$NON-NLS-1$
               
        MappingSequenceNode seq2 = src2.addSequenceNode(new MappingSequenceNode());
        seq2.addChildElement(new MappingElement("key", "xqttest.data2.intKey")); //$NON-NLS-1$ //$NON-NLS-2$
        seq2.addChildElement(new MappingElement("data", "xqttest.data2.intNum")); //$NON-NLS-1$ //$NON-NLS-2$
       
        MappingElement recursive = seq2.addChildElement(new MappingRecursiveElement("srcNestedRecursive", "xqttest.data2")); //$NON-NLS-1$ //$NON-NLS-2$
        recursive.setSource("xqttest.data3"); //$NON-NLS-1$
       
        MappingElement recursive2 = seq1.addChildElement(new MappingRecursiveElement("srcRecursive", "xqttest.data")); //$NON-NLS-1$ //$NON-NLS-2$
        recursive2.setSource("xqttest.data4"); //$NON-NLS-1$
       
        return doc;
    }
View Full Code Here

Examples of org.teiid.query.mapping.xml.MappingElement

   * Method createXQTPlanRecursive.
   * @return Object
   */
    private static MappingNode createXQTPlanRecursive1a_5988() {
        MappingDocument doc = new MappingDocument(true);
        MappingElement root = doc.addChildElement(new MappingElement("recursiveTest")); //$NON-NLS-1$

        MappingElement src1 = root.addChildElement(new MappingElement("src")); //$NON-NLS-1$
        src1.setSource("xqttest.data"); //$NON-NLS-1$

        MappingSequenceNode seq1 = new MappingSequenceNode();
        seq1.addChildElement(new MappingElement("key", "xqttest.data.intKey")); //$NON-NLS-1$ //$NON-NLS-2$
        seq1.addChildElement(new MappingElement("data", "xqttest.data.intNum")); //$NON-NLS-1$ //$NON-NLS-2$
        src1.addSequenceNode(seq1);

        MappingElement src2 = seq1.addChildElement(new MappingElement("srcNested")); //$NON-NLS-1$
        src2.setSource("xqttest.data2"); //$NON-NLS-1$

        MappingSequenceNode seq2 = src2.addSequenceNode(new MappingSequenceNode());
        seq2.addChildElement(new MappingElement("key", "xqttest.data2.intKey")); //$NON-NLS-1$ //$NON-NLS-2$
        seq2.addChildElement(new MappingElement("data", "xqttest.data2.intNum")); //$NON-NLS-1$ //$NON-NLS-2$
       
        MappingElement recursive = seq2.addChildElement(new MappingRecursiveElement("srcRecursive", "xqttest.data2")); //$NON-NLS-1$ //$NON-NLS-2$
        recursive.setSource("xqttest.data3"); //$NON-NLS-1$
       
        MappingElement recursive2 = seq1.addChildElement(new MappingRecursiveElement("srcRecursive", "xqttest.data")); //$NON-NLS-1$ //$NON-NLS-2$
        recursive2.setSource("xqttest.data4"); //$NON-NLS-1$
       
        return doc;
    }
View Full Code Here

Examples of org.teiid.query.mapping.xml.MappingElement

     * all nested "anchor" nodes are named "srcNested".  Test of defect #5988
     * @return Object
     */
    private static MappingNode createXQTPlanRecursive3_5988() {  
        MappingDocument doc = new MappingDocument(true);
        MappingElement root = doc.addChildElement(new MappingElement("recursiveTest")); //$NON-NLS-1$

        MappingElement src1 = root.addChildElement(new MappingElement("src")); //$NON-NLS-1$
        src1.setSource("xqttest.data"); //$NON-NLS-1$

        MappingSequenceNode seq1 = src1.addSequenceNode(new MappingSequenceNode());
        seq1.addChildElement(new MappingElement("key", "xqttest.data.intKey")); //$NON-NLS-1$ //$NON-NLS-2$
        seq1.addChildElement(new MappingElement("data", "xqttest.data.intNum")); //$NON-NLS-1$ //$NON-NLS-2$

        MappingElement src2 = seq1.addChildElement(new MappingElement("srcNested")); //$NON-NLS-1$
        src2.setSource("xqttest.data2"); //$NON-NLS-1$
       
        MappingSequenceNode seq2 = src2.addSequenceNode(new MappingSequenceNode());
        seq2.addChildElement(new MappingElement("key", "xqttest.data2.intKey")); //$NON-NLS-1$ //$NON-NLS-2$
        seq2.addChildElement(new MappingElement("data", "xqttest.data2.intNum")); //$NON-NLS-1$ //$NON-NLS-2$

        MappingElement nested = seq1.addChildElement(new MappingRecursiveElement("srcNested", "xqttest.data")); //$NON-NLS-1$ //$NON-NLS-2$
        nested.setSource("xqttest.data4"); //$NON-NLS-1$
       
        return doc;
    }
View Full Code Here

Examples of org.teiid.query.mapping.xml.MappingElement

    }
   
   
    private static MappingNode createXQTPlanRecursiveSiblings() {
        MappingDocument doc = new MappingDocument(true);
        MappingElement root = doc.addChildElement(new MappingElement("recursiveTest")); //$NON-NLS-1$

        MappingElement src1 = root.addChildElement(new MappingElement("src")); //$NON-NLS-1$
        src1.setSource("xqttest.data"); //$NON-NLS-1$

        MappingSequenceNode seq1 = src1.addSequenceNode(new MappingSequenceNode());
        seq1.addChildElement(new MappingElement("key", "xqttest.data.intKey")); //$NON-NLS-1$ //$NON-NLS-2$
        seq1.addChildElement(new MappingElement("data", "xqttest.data.intNum")); //$NON-NLS-1$ //$NON-NLS-2$

        MappingElement sibiling1 = seq1.addChildElement(new MappingRecursiveElement("srcSibling1", "xqttest.data")); //$NON-NLS-1$ //$NON-NLS-2$
        sibiling1.setSource("xqttest.data2"); //$NON-NLS-1$
        sibiling1.setMaxOccurrs(-1);
        MappingElement sibiling2 = seq1.addChildElement(new MappingRecursiveElement("srcSibling2", "xqttest.data")); //$NON-NLS-1$ //$NON-NLS-2$
        sibiling2.setSource("xqttest.data2");//$NON-NLS-1$
        sibiling2.setMaxOccurrs(-1);
        return doc;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.