Examples of MappingElement


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

    }   
   
   
    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

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

    }

    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

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

    }    
   

    private static MappingNode createXMLPlan2(int numChoices, int numDefaultChoice, boolean exception_on_Default) {
        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 STUFF
        //choice node, non-visual, so it has no name       
        MappingChoiceNode choice = items.addChoiceNode(new MappingChoiceNode(exception_on_Default));
        choice.setSource("xmltest.group.items"); //$NON-NLS-1$
        choice.setMaxOccurrs(-1);
        if (numChoices >= 1){
            MappingCriteriaNode item = getChoiceChild("Item", "xmltest.group.items.itemName='Lamp'", numDefaultChoice == 1); //$NON-NLS-1$ //$NON-NLS-2$
            choice.addCriteriaNode(item);
View Full Code Here

Examples of org.uengine.kernel.MappingElement

      
       if(linkedPair.getSource() instanceof TransformerArgument && linkedPair.getTarget() instanceof Record){
         TransformerArgument source = (TransformerArgument) linkedPair.getSource();
         Record target = (Record) linkedPair.getTarget();
        
         paramContext = new MappingElement();

         TextContext argumentText = TextContext.createInstance();
         argumentText.setText(target.getReferenceName());
         paramContext.setArgument(argumentText);
        
         ((MappingElement)paramContext).setKey(Record.KEY == target.getKeyType());
         //paramContext.setVariable(ProcessVariable.forName(source.getReferenceName()));
        
         if(target.getExtendedProperties()!=null && target.getExtendedProperties().containsKey("type")){
           paramContext.setType((Class)target.getExtendedProperties().get("type"));
         }
        
         source.getTransformer().beforeSerialization();
        
         TransformerMapping transformerMapping = new TransformerMapping();
         transformerMapping.setTransformer(source.getTransformer());
         transformerMapping.setLinkedArgumentName(source.getName());
        
         paramContext.setTransformerMapping(transformerMapping);
        
       }else if (linkedPair.getSource() instanceof Record && linkedPair.getTarget() instanceof Record){
      
        
         Record source = (Record) linkedPair.getSource();
         Record target = (Record) linkedPair.getTarget();
        
         paramContext = new MappingElement();
         TextContext argumentText = TextContext.createInstance();
         argumentText.setText(target.getReferenceName());
         paramContext.setArgument(argumentText);
         paramContext.setVariable(ProcessVariable.forName(source.getReferenceName()));
         ((MappingElement)paramContext).setKey(Record.KEY == target.getKeyType());
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.