Package org.teiid.query.mapping.xml

Examples of org.teiid.query.mapping.xml.MappingDocument.addChildElement()


        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$       
       
View Full Code Here


    }   
   
    private static MappingNode createGroupDoc() {
        MappingDocument doc = new MappingDocument(true);
       
        MappingElement root = doc.addChildElement(new MappingElement("group")); //$NON-NLS-1$
        root.setSource("xqttest.group"); //$NON-NLS-1$
        root.setMinOccurrs(0);
        root.setMaxOccurrs(-1);
       
        MappingAttribute attr = new MappingAttribute("pseudoID", "xqttest.group.ID"); //$NON-NLS-1$ //$NON-NLS-2$        
View Full Code Here

    }  
   
    private static MappingNode createXMLPlanNormalization(String normMode) {

        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$

        //choice node, non-visual, so it has no name       
View Full Code Here

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

        root.setStagingTables(Arrays.asList(new String[] {"tempGroup.orders"})); //$NON-NLS-1$
       
        MappingElement cats = root.addChildElement(new MappingElement("Catalog")); //$NON-NLS-1$
        MappingElement items = cats.addChildElement(new MappingElement("Items")); //$NON-NLS-1$
View Full Code Here

    }
   
    public void testDoc2() {
        MappingDocument doc = new MappingDocument("UTF-16", false); //$NON-NLS-1$
        MappingElement root = new MappingElement("test"); //$NON-NLS-1$
        doc.addChildElement(root);
        assertNotNull(doc.getRootNode());
       
        assertFalse(doc.isFormatted());
        assertEquals("UTF-16", doc.getDocumentEncoding()); //$NON-NLS-1$
    }
View Full Code Here

        MappingDocument doc = new MappingDocument("UTF-16", false); //$NON-NLS-1$
        MappingElement root = new MappingElement("test"); //$NON-NLS-1$
        root.setMinOccurrs(2);
        root.setMaxOccurrs(-1);
       
        doc.addChildElement(root);
       
        assertNotNull(doc.getRootNode());
       
        assertFalse(doc.isFormatted());
        assertEquals("UTF-16", doc.getDocumentEncoding()); //$NON-NLS-1$
View Full Code Here

        assertTrue(list.get(4) instanceof MappingAllNode);
    }
   
    public void testAddRecursiveElement() {
        MappingDocument doc = new MappingDocument(false);
        MappingElement root = doc.addChildElement(new MappingElement("root")); //$NON-NLS-1$
       
        MappingElement nodeA = root.addChildElement(new MappingElement("NodeA", "test.nodea")); //$NON-NLS-1$ //$NON-NLS-2$
        nodeA.setSource("recursive.test"); //$NON-NLS-1$

        MappingSequenceNode seq = nodeA.addSequenceNode(new MappingSequenceNode());
View Full Code Here

        assertTrue(nodeA.isRootRecursiveNode());
    }
   
    public void testAddBADRecursiveElement() {
        MappingDocument doc = new MappingDocument(false);
        MappingElement root = doc.addChildElement(new MappingElement("root")); //$NON-NLS-1$
       
        MappingElement nodeA = root.addChildElement(new MappingElement("NodeA", "test.nodea")); //$NON-NLS-1$ //$NON-NLS-2$
        nodeA.setSource("recursive.test"); //$NON-NLS-1$
       
        MappingSequenceNode seq = nodeA.addSequenceNode(new MappingSequenceNode());
View Full Code Here

    return new FakeMetadataFacade(store);
  }

    private static MappingDocument exampleDoc1() {
        MappingDocument doc = new MappingDocument(false);
        MappingElement root = doc.addChildElement(new MappingElement("root")); //$NON-NLS-1$
        MappingElement node1 = root.addChildElement(new MappingElement("node1")); //$NON-NLS-1$
        MappingElement node2 = node1.addChildElement(new MappingElement("node2")); //$NON-NLS-1$
        node2.addChildElement(new MappingElement("node3")); //$NON-NLS-1$       
        return doc;
    }
View Full Code Here

    }

    private static MappingDocument exampleDoc2() {
       
        MappingDocument doc = new MappingDocument(false);
        MappingElement root = doc.addChildElement(new MappingElement("root")); //$NON-NLS-1$
        MappingElement node1 = root.addChildElement(new MappingElement("node1")); //$NON-NLS-1$
       
        MappingSequenceNode node2 = node1.addSequenceNode(new MappingSequenceNode());   
        node2.addChildElement(new MappingElement("node3")); //$NON-NLS-1$
        root.addChildElement(new MappingElement("node2")); //$NON-NLS-1$
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.