Package org.teiid.query.mapping.xml

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


        assertTrue(list.get(3) instanceof MappingSequenceNode);
        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

    public MappingNode getMappingNode(Object groupID)
        throws TeiidComponentException, QueryMetadataException {
      ArgCheck.isInstanceOf(FakeMetadataObject.class, groupID);
      FakeMetadataObject group = (FakeMetadataObject) groupID;
        MappingDocument doc = (MappingDocument)group.getProperty(FakeMetadataObject.Props.PLAN);
        doc.setName(getFullName(groupID));
        return doc;
    }
View Full Code Here

  public Collection getXMLTempGroups(Object groupID)
        throws TeiidComponentException, QueryMetadataException{

    ArgCheck.isInstanceOf(FakeMetadataObject.class, groupID);
    MappingDocument mappingDoc = (MappingDocument)((FakeMetadataObject)groupID).getProperty(FakeMetadataObject.Props.PLAN);
        List tempGroups = resolveGroups(getStagingTables(mappingDoc));
        return tempGroups;
    }
View Full Code Here

    // Create the facade from the store
    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

        return doc;
    }

    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

        return doc;
    }

    // has ambiguous short and long names
    private static MappingDocument exampleDoc3() {
        MappingDocument doc = new MappingDocument(false);
        MappingElement root = doc.addChildElement(new MappingElement("root")); //$NON-NLS-1$

        MappingSequenceNode node1 = root.addSequenceNode(new MappingSequenceNode());   
        node1.addChildElement(new MappingElement("node2")); //$NON-NLS-1$
        root.addChildElement(new MappingElement("node2")); //$NON-NLS-1$
        return doc;
View Full Code Here

   
  
    // has attributes and elements
    private static MappingDocument exampleDoc4() {
       
        MappingDocument doc = new MappingDocument(false);
       
        MappingElement root = doc.addChildElement(new MappingElement("root")); //$NON-NLS-1$

        root.addAttribute(new MappingAttribute("node6")); //$NON-NLS-1$
        root.addStagingTable("tm1.g1"); //$NON-NLS-1$
       
        MappingElement node1 =root.addChildElement(new MappingElement("node1")); //$NON-NLS-1$
View Full Code Here

        return doc;
    }   

    // has a union in the mapping class
    private static MappingDocument exampleDoc5() {
        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$
        node1.addChildElement(new MappingElement("node2","xmltest.mc1.e1")); //$NON-NLS-1$ //$NON-NLS-2$
        node1.setSource("xmltest.mc1"); //$NON-NLS-1$
        node1.setMaxOccurrs(-1);
View Full Code Here

        return doc;
   
   
    // has two elements with common suffix, but not ambiguous
    private static MappingDocument exampleDoc6() {
        MappingDocument doc = new MappingDocument(false);
        MappingElement root = doc.addChildElement(new MappingElement("root")); //$NON-NLS-1$

        root.addChildElement(new MappingElement("node")); //$NON-NLS-1$
        root.addChildElement(new MappingElement("thenode")); //$NON-NLS-1$
        return doc;
    }   
View Full Code Here

TOP

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

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.