Package org.teiid.query.mapping.xml

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


    }

    // 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

    }   

    // 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

   
   
    // 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

            new String[] { "employeeNum", "firstName", "lastName", "supervisorNum", "specializesInItemNum", "supplierNumFK" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
            new String[] { DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.STRING});

        // MAPPING DOC ======================================================================
        MappingDocument doc = new MappingDocument(true);
        MappingElement root = doc.addChildElement(new MappingElement("Catalogs")); //$NON-NLS-1$
       
        MappingElement cats = root.addChildElement(new MappingElement("Catalog")); //$NON-NLS-1$
        MappingElement itemsA = cats.addChildElement(new MappingElement("Items")); //$NON-NLS-1$

        MappingElement item = itemsA.addChildElement(new MappingElement("Item")); //$NON-NLS-1$
View Full Code Here


       
        // MAPPING DOC - baseball players ======================================================================
        MappingDocument doc2 = new MappingDocument(true);
        MappingElement root2 = doc2.addChildElement(new MappingElement("BaseballPlayers")); //$NON-NLS-1$
       
        MappingElement player = root2.addChildElement(new MappingElement("Player")); //$NON-NLS-1$
        player.setSource("xmltest.players"); //$NON-NLS-1$
        player.setMaxOccurrs(-1);
        player.addAttribute(new MappingAttribute("PlayerID", "xmltest.players.employeeNum")); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

        stagingTables.add("testTempGroup1"); //$NON-NLS-1$
        stagingTables.add("testTempGroup2"); //$NON-NLS-1$
       
        MappingDocument doc = new MappingDocument("UTF-8", true); //$NON-NLS-1$
       
        MappingElement element = doc.addChildElement(new MappingElement("license")); //$NON-NLS-1$
        element.setStagingTables(stagingTables);
        element.setSource("licenseSource"); //$NON-NLS-1$
        element.setMinOccurrs(0);
        element.setMaxOccurrs(-1);
       
View Full Code Here

        stagingTables.add("testTempGroup1"); //$NON-NLS-1$
        stagingTables.add("testTempGroup2"); //$NON-NLS-1$
       
        MappingDocument doc = new MappingDocument("UTF-8", true); //$NON-NLS-1$
       
        MappingElement element = doc.addChildElement(new MappingElement("parentNode")); //$NON-NLS-1$
        element.setMinOccurrs(0);
        element.setMaxOccurrs(-1);
        element.setStagingTables(stagingTables);

        MappingElement child = element.addChildElement(new MappingElement("childNode"));//$NON-NLS-1$
View Full Code Here

                "</mappingNode>" //$NON-NLS-1$
            "</xmlMapping>"; //$NON-NLS-1$
       
       
        MappingDocument doc = new MappingDocument(false);
        MappingElement element = doc.addChildElement(new MappingElement("parentNode")); //$NON-NLS-1$
        MappingChoiceNode choice = element.addChoiceNode(new MappingChoiceNode(true));
        MappingCriteriaNode criteria = choice.addCriteriaNode(new MappingCriteriaNode("childNodeCriteria", false)); //$NON-NLS-1$
        criteria.addChildElement(new MappingElement("childNode")); //$NON-NLS-1$

        String savedXML = saveMappingDocument(doc);
View Full Code Here

                    "<builtInType>decimal</builtInType>" + //$NON-NLS-1$
               "</mappingNode>" //$NON-NLS-1$
            "</xmlMapping>"; //$NON-NLS-1$
       
        MappingDocument doc = new MappingDocument(false);
        MappingElement element = doc.addChildElement(new MappingElement("parentNode")); //$NON-NLS-1$
        element.setNillable(true);
        element.setExclude(true);
        element.setDefaultValue("ddd"); //$NON-NLS-1$
        element.setValue("fff"); //$NON-NLS-1$
        element.setOptional(true);
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.