Package org.teiid.query.mapping.xml

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


        return doc; 
    }

    private static MappingNode createXMLPlanRecursive(boolean useRecursiveCriteria, int recursionLimit, boolean exceptionOnLimit) {
        MappingDocument doc = new MappingDocument(true);
        MappingElement root = doc.addChildElement(new MappingElement("OrgHierarchy")); //$NON-NLS-1$
       
        MappingElement ceo = root.addChildElement(new MappingElement("Employee")); //$NON-NLS-1$
        ceo.setSource("xmltest.employees"); //$NON-NLS-1$
        ceo.setMinOccurrs(0);
        ceo.setMaxOccurrs(-1);
        ceo.addAttribute(new MappingAttribute("ID", "xmltest.employees.employeeNum")); //$NON-NLS-1$ //$NON-NLS-2$

        MappingSequenceNode sequence = ceo.addSequenceNode(new MappingSequenceNode());
        sequence.addChildElement(new MappingElement("FirstName", "xmltest.employees.firstName")); //$NON-NLS-1$ //$NON-NLS-2$
        sequence.addChildElement(new MappingElement("LastName", "xmltest.employees.lastName")); //$NON-NLS-1$ //$NON-NLS-2$
        MappingElement subordinates = sequence.addChildElement(new MappingElement("Subordinates")); //$NON-NLS-1$
       
        //recursive piece
        MappingRecursiveElement employee = (MappingRecursiveElement)subordinates.addChildElement(new MappingRecursiveElement("Employee", "xmltest.employees")); //$NON-NLS-1$ //$NON-NLS-2$
        employee.setSource("xmltest.employeesRecursive"); //$NON-NLS-1$
        employee.setMinOccurrs(0);
        employee.setMaxOccurrs(-1);

        if (useRecursiveCriteria){
View Full Code Here


    /*
     * Recursion root mapping class is anchored at sequence node instead of "Employee" node
     */
    private static MappingNode createXMLPlanRecursiveA(boolean useRecursiveCriteria, int recursionLimit, boolean exceptionOnLimit) {
        MappingDocument doc = new MappingDocument(true);
        MappingElement root = doc.addChildElement(new MappingElement("OrgHierarchy")); //$NON-NLS-1$

        MappingSequenceNode seq0 = root.addSequenceNode(new MappingSequenceNode());
        seq0.setSource("xmltest.employees"); //$NON-NLS-1$
        seq0.setMinOccurrs(0);
        seq0.setMaxOccurrs(-1);
       
        MappingElement ceo = seq0.addChildElement(new MappingElement("Employee")); //$NON-NLS-1$
        ceo.addAttribute(new MappingAttribute("ID", "xmltest.employees.employeeNum")); //$NON-NLS-1$ //$NON-NLS-2$

        MappingSequenceNode seq = ceo.addSequenceNode(new MappingSequenceNode());
        seq.addChildElement(new MappingElement("FirstName", "xmltest.employees.firstName")); //$NON-NLS-1$ //$NON-NLS-2$
        seq.addChildElement(new MappingElement("LastName", "xmltest.employees.lastName")); //$NON-NLS-1$ //$NON-NLS-2$
        MappingElement subordinates = seq.addChildElement(new MappingElement("Subordinates")); //$NON-NLS-1$

        //recursive piece
        MappingRecursiveElement employee = (MappingRecursiveElement)subordinates.addChildElement(new MappingRecursiveElement("Subordinate", "xmltest.employees")); //$NON-NLS-1$ //$NON-NLS-2$
        employee.setSource("xmltest.employeesRecursive")//$NON-NLS-1$
        employee.setMinOccurrs(0);
        employee.setMaxOccurrs(-1);

        if (useRecursiveCriteria){
View Full Code Here

   
    private static MappingNode createXMLPlanRecursiveStaging(boolean useRecursiveCriteria, int recursionLimit, boolean exceptionOnLimit) {
       
        MappingDocument doc = new MappingDocument(true);
       
        MappingElement root = doc.addChildElement(new MappingElement("OrgHierarchy")); //$NON-NLS-1$
        root.setStagingTables(Arrays.asList(new String[] {"xmltest.doc19temp"})); //$NON-NLS-1$

        MappingElement ceo = root.addChildElement(new MappingElement("Employee")); //$NON-NLS-1$
        ceo.setSource("xmltest.employeesDoc19"); //$NON-NLS-1$
        ceo.setMinOccurrs(0);
        ceo.setMaxOccurrs(-1);
        ceo.addAttribute(new MappingAttribute("ID", "xmltest.employeesDoc19.employeeNum")); //$NON-NLS-1$ //$NON-NLS-2$

        MappingSequenceNode seq = ceo.addSequenceNode(new MappingSequenceNode());
        seq.addChildElement(new MappingElement("FirstName", "xmltest.employeesDoc19.firstName")); //$NON-NLS-1$ //$NON-NLS-2$
        seq.addChildElement(new MappingElement("LastName", "xmltest.employeesDoc19.lastName")); //$NON-NLS-1$ //$NON-NLS-2$
        MappingElement subordinates = seq.addChildElement(new MappingElement("Subordinates")); //$NON-NLS-1$

        //recursive piece
        MappingRecursiveElement employee = (MappingRecursiveElement)subordinates.addChildElement(new MappingRecursiveElement("Employee", "xmltest.employeesDoc19")); //$NON-NLS-1$ //$NON-NLS-2$
        employee.setSource("xmltest.employeesRecursiveDoc19"); //$NON-NLS-1$
        employee.setMinOccurrs(0);
        employee.setMaxOccurrs(-1);

        if (useRecursiveCriteria){
View Full Code Here

        return doc; 
    }
   
    private static MappingNode createXMLPlanRecursive2(boolean useRecursiveCriteria, int recursionLimit, boolean exceptionOnLimit) {
        MappingDocument doc = new MappingDocument(true);
        MappingElement root = doc.addChildElement(new MappingElement("Employees")); //$NON-NLS-1$

        MappingElement ceo = root.addChildElement(new MappingElement("Employee")); //$NON-NLS-1$
        ceo.setSource("xmltest.employees2"); //$NON-NLS-1$
        ceo.setMinOccurrs(0);
        ceo.setMaxOccurrs(-1);
        ceo.addAttribute(new MappingAttribute("ID", "xmltest.employees2.employeeNum")); //$NON-NLS-1$ //$NON-NLS-2$

        MappingSequenceNode seq = ceo.addSequenceNode(new MappingSequenceNode());
        seq.addChildElement(new MappingElement("FirstName", "xmltest.employees2.firstName")); //$NON-NLS-1$ //$NON-NLS-2$
        seq.addChildElement(new MappingElement("LastName", "xmltest.employees2.lastName")); //$NON-NLS-1$ //$NON-NLS-2$

        //recursive piece
        MappingRecursiveElement employee = (MappingRecursiveElement)seq.addChildElement(new MappingRecursiveElement("Supervisor", "xmltest.employees2")); //$NON-NLS-1$ //$NON-NLS-2$
        employee.setSource("xmltest.employees2Recursive"); //$NON-NLS-1$
        employee.setMinOccurrs(0);
View Full Code Here

    private static MappingNode createXMLPlan_defect8917() {
       
        Namespace namespace1 = new Namespace("xsi", "http://www.w3.org/2001/XMLSchema-instance"); //$NON-NLS-1$ //$NON-NLS-2$
       
        MappingDocument doc = new MappingDocument(true);
        MappingElement root = doc.addChildElement(new MappingElement("Catalogs")); //$NON-NLS-1$

        root.addNamespace(namespace1);

        {      
        //FRAGMENT 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.setMaxOccurrs(-1);
        item.addAttribute(new MappingAttribute("ItemID", "xmltest.group.items.itemNum")); //$NON-NLS-1$ //$NON-NLS-2$
        item.addChildElement(new MappingElement("Name", "xmltest.group.items.itemName")) //$NON-NLS-1$ //$NON-NLS-2$
            .setNillable(true);       
        item.addChildElement(new MappingElement("Quantity", "xmltest.group.items.itemQuantity")); //$NON-NLS-1$ //$NON-NLS-2$
        }
       
        {
        //FRAGMENT 2
        MappingElement cat = root.addChildElement(new MappingElement("OptionalCatalog")); //$NON-NLS-1$
        cat.setMinOccurrs(0);
       
        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.setMaxOccurrs(-1);
        item.addAttribute(new MappingAttribute("ItemID", "xmltest.group.items.itemNum")); //$NON-NLS-1$ //$NON-NLS-2$
        item.addChildElement(new MappingElement("Name", "xmltest.group.items.itemName")) //$NON-NLS-1$ //$NON-NLS-2$
          .setNillable(true);
        item.addChildElement(new MappingElement("Quantity", "xmltest.group.items.itemQuantity")); //$NON-NLS-1$ //$NON-NLS-2$
        }
       
        {
        //FRAGMENT 3
        MappingElement cat = root.addChildElement(new MappingElement("OptionalCatalog2")); //$NON-NLS-1$
        cat.setMinOccurrs(0);
       
        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.setMaxOccurrs(-1);
        item.addChildElement(new MappingElement("Name", "xmltest.group.items.itemName")) //$NON-NLS-1$ //$NON-NLS-2$
            .setNillable(true);              
        }       
       
        {
        //FRAGMENT 4
        MappingElement cat = root.addChildElement(new MappingElement("OptionalCatalog3")); //$NON-NLS-1$
        cat.setMinOccurrs(0);       
        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.setMaxOccurrs(-1);
        item.addChildElement(new MappingElement("Name", "xmltest.group.items.itemName")); //$NON-NLS-1$ //$NON-NLS-2$
        }
       
        {
        //FRAGMENT 5
        MappingElement cat = root.addChildElement(new MappingElement("Catalog4")); //$NON-NLS-1$
        MappingElement items = cat.addChildElement(new MappingElement("OptionalItems")); //$NON-NLS-1$
        items.setMinOccurrs(0);
       
        MappingElement item = items.addChildElement(new MappingElement("Item")); //$NON-NLS-1$
        item.setSource("xmltest.group.items"); //$NON-NLS-1$
        item.setMaxOccurrs(-1);
        item.addChildElement(new MappingElement("Name", "xmltest.group.items.itemName")); //$NON-NLS-1$ //$NON-NLS-2$
        }                
       
        {
        //FRAGMENT 6           
        MappingElement cat = root.addChildElement(new MappingElement("Catalog5")); //$NON-NLS-1$
        MappingElement items = cat.addChildElement(new MappingElement("OptionalItems")); //$NON-NLS-1$
        items.setMinOccurrs(0);
       
        MappingElement item = items.addChildElement(new MappingElement("Item")); //$NON-NLS-1$
        item.addChildElement(new MappingElement("FixedName")) //$NON-NLS-1$
            .setValue("Nugent"); //$NON-NLS-1$
        }       

        {
        //FRAGMENT 7           
        MappingElement cat = root.addChildElement(new MappingElement("Catalog6")); //$NON-NLS-1$
        MappingElement items = cat.addChildElement(new MappingElement("OptionalItems")); //$NON-NLS-1$
        items.setMinOccurrs(0);
       
        MappingElement item = items.addChildElement(new MappingElement("Item")); //$NON-NLS-1$
        item.addChildElement(new MappingElement("EmptyName")); //$NON-NLS-1$
        }       
        return doc;                               
    }
View Full Code Here

    /*
     * Test of identically named nodes
     */
    private static MappingNode createXMLPlan_defect9446() {
        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.setMaxOccurrs(-1);
        item.addAttribute(new MappingAttribute("XXXXX", "xmltest.group.items.itemNum")); //$NON-NLS-1$ //$NON-NLS-2$
        item.addChildElement(new MappingElement("XXXXX", "xmltest.group.items.itemName")); //$NON-NLS-1$ //$NON-NLS-2$
        item.addChildElement(new MappingElement("XXXXX", "xmltest.group.items.itemQuantity")); //$NON-NLS-1$ //$NON-NLS-2$
        return doc;                               
    }
View Full Code Here

        Namespace namespace = new Namespace("mm", "http://www.duh.org/duh"); //$NON-NLS-1$ //$NON-NLS-2$
        Namespace namespace2 = new Namespace("mm", "http://www.duh2.org/duh2"); //$NON-NLS-1$ //$NON-NLS-2$
        Namespace namespace3 = new Namespace("mm2", "http://www.duh3.org/duh3"); //$NON-NLS-1$ //$NON-NLS-2$
       
        MappingDocument doc = new MappingDocument(true);
        MappingElement root = doc.addChildElement(new MappingElement("Catalogs", namespace)); //$NON-NLS-1$
        root.addNamespace(namespace);

        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", namespace)); //$NON-NLS-1$
        item.setSource("xmltest.group.items"); //$NON-NLS-1$
        item.setMaxOccurrs(-1);
        item.addNamespace(namespace2);
        item.addNamespace(namespace3);

        item.addAttribute(new MappingAttribute("ItemID", "xmltest.group.items.itemNum")); //$NON-NLS-1$ //$NON-NLS-2$
        item.addChildElement(new MappingElement("Name", "xmltest.group.items.itemName")); //$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

        return facade;
    }
 
    private static MappingNode createXQTPlanChoice_6796() {
        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$
       
        MappingElement keys = key.addChildElement(new MappingElement("keys")); //$NON-NLS-1$
        keys.setSource("xqttest.data8"); //$NON-NLS-1$
        keys.setMaxOccurrs(-1);
        keys.addChildElement(new MappingElement("nestedkey", "xqttest.data8.intKey")); //$NON-NLS-1$ //$NON-NLS-2$
       
        MappingCriteriaNode wrapper2 = choice.addCriteriaNode(new MappingCriteriaNode(null, true));
       
        key = wrapper2.addChildElement( new MappingElement("key", "xqttest.data7.intKey")); //$NON-NLS-1$ //$NON-NLS-2$
       
        keys = key.addChildElement(new MappingElement("keys")); //$NON-NLS-1$
        keys.setSource("xqttest.data8"); //$NON-NLS-1$
        keys.setMaxOccurrs(-1);
        keys.addChildElement(new MappingElement("nestedkey", "xqttest.data8.intKey")); //$NON-NLS-1$ //$NON-NLS-2$
       
        return doc;
    }
View Full Code Here

    }   
   
   
    private static MappingElement createXMLPlan1Unformatted( boolean testNillable, int cardinality ) {

        MappingElement root = 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$
        items.setNillable(testNillable);
        items.setMinOccurrs(cardinality);
           
        MappingElement item = items.addChildElement(new MappingElement("Item")); //$NON-NLS-1$
        item.setSource("xmltest.group.items"); //$NON-NLS-1$
        item.setMaxOccurrs(-1);
        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 root;                               
    }
View Full Code Here

    }

    private static MappingNode createXMLPlanDefect13617() {

        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.setMaxOccurrs(-1);
        item.setMinOccurrs(0);
       
        item.addAttribute(new MappingAttribute("ItemID", "xmltest.group.items.itemNum")); //$NON-NLS-1$ //$NON-NLS-2$
        item.addChildElement(new MappingElement("Name", "xmltest.group.items.itemName")) //$NON-NLS-1$ //$NON-NLS-2$
            .setMinOccurrs(0);
        item.addChildElement(new MappingElement("Quantity", "xmltest.group.items.itemQuantity")) //$NON-NLS-1$ //$NON-NLS-2$       
            .setMinOccurrs(0);
        return doc;                               
    }    
View Full Code Here

TOP

Related Classes of org.teiid.query.mapping.xml.MappingElement

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.