Package org.eclipse.persistence.oxm.mappings

Examples of org.eclipse.persistence.oxm.mappings.XMLChoiceObjectMapping


        }
        return mapping;
    }
   
    private DatabaseMapping buildXMLChoiceObjectMapping(String mappingUri) {
        XMLChoiceObjectMapping mapping = new XMLChoiceObjectMapping();
        mapping.setAttributeName(getName());

        //First add XPath for this property
        String xPath = getQualifiedXPath(mappingUri, getType().isDataType());
        mapping.addChoiceElement(xPath, getType().getImplClass());
        //For each substitutable property, create the xpath and add it.
        Iterator<SDOProperty> properties = this.getSubstitutableElements().iterator();
        while(properties.hasNext()) {
            SDOProperty nextProp = properties.next();
            xPath = nextProp.getQualifiedXPath(mappingUri, nextProp.getType().isDataType(), getContainingType());
            mapping.addChoiceElement(xPath, nextProp.getType().getImplClass());
        }
        return mapping;
    }
View Full Code Here


                            }
                            addChild(xmlFld.getXPathFragment(), mappingNodeValue, xmlDescriptor.getNamespaceResolver());
                        }
                        continue;
                    } else if (xmlMapping instanceof XMLChoiceObjectMapping) {
                        XMLChoiceObjectMapping xmlChoiceMapping = (XMLChoiceObjectMapping)xmlMapping;
                        Iterator fields = xmlChoiceMapping.getChoiceElementMappings().keySet().iterator();
                        XMLField firstField = (XMLField)fields.next();
                        XMLChoiceObjectMappingNodeValue firstNodeValue = new XMLChoiceObjectMappingNodeValue(xmlChoiceMapping, firstField);
                        firstNodeValue.setNullCapableNodeValue(firstNodeValue);
                        this.addNullCapableValue(firstNodeValue);
                        addChild(firstField.getXPathFragment(), firstNodeValue, xmlDescriptor.getNamespaceResolver());
                        while(fields.hasNext()) {
                            XMLField next = (XMLField)fields.next();
                            XMLChoiceObjectMappingNodeValue nodeValue = new XMLChoiceObjectMappingNodeValue(xmlChoiceMapping, next);
                            nodeValue.setNullCapableNodeValue(firstNodeValue);
                            addChild(next.getXPathFragment(), nodeValue, xmlDescriptor.getNamespaceResolver());
                        }
                        continue;
                    } else if(xmlMapping instanceof XMLChoiceCollectionMapping) {
                        XMLChoiceCollectionMapping xmlChoiceMapping = (XMLChoiceCollectionMapping)xmlMapping;
                        Iterator fields = xmlChoiceMapping.getChoiceElementMappings().keySet().iterator();
                        XMLField firstField = (XMLField)fields.next();
                        XMLChoiceCollectionMappingUnmarshalNodeValue unmarshalValue = new XMLChoiceCollectionMappingUnmarshalNodeValue(xmlChoiceMapping, firstField);
                        XMLChoiceCollectionMappingMarshalNodeValue marshalValue = new XMLChoiceCollectionMappingMarshalNodeValue(xmlChoiceMapping, firstField);
                        HashMap<XMLField, NodeValue> fieldToNodeValues = new HashMap<XMLField, NodeValue>();
                        unmarshalValue.setContainerNodeValue(unmarshalValue);
View Full Code Here

        resultMapping.setAttributeName("result");
        resultMapping.setReferenceClass(Result.class);
        resultMapping.setXPath( "result");
        descriptor.addMapping(resultMapping);

        XMLChoiceObjectMapping queryHandlerMapping = new XMLChoiceObjectMapping();
        queryHandlerMapping.setAttributeName("queryHandler");
        queryHandlerMapping.addChoiceElement("jpql", JPQLQueryHandler.class);
        queryHandlerMapping.addChoiceElement("named-query", NamedQueryHandler.class);
        queryHandlerMapping.addChoiceElement("sql", SQLQueryHandler.class);
        queryHandlerMapping.addChoiceElement("stored-procedure",
            StoredProcedureQueryHandler.class);
        queryHandlerMapping.addChoiceElement("stored-function",
            StoredFunctionQueryHandler.class);
        descriptor.addMapping(queryHandlerMapping);

        return descriptor;
    }
View Full Code Here

        resultMapping.setAttributeName("result");
        resultMapping.setReferenceClass(Result.class);
        resultMapping.setXPath( "result");
        descriptor.addMapping(resultMapping);

        XMLChoiceObjectMapping queryHandlerMapping = new XMLChoiceObjectMapping();
        queryHandlerMapping.setAttributeName("queryHandler");
        queryHandlerMapping.addChoiceElement("jpql", JPQLQueryHandler.class);
        queryHandlerMapping.addChoiceElement("named-query", NamedQueryHandler.class);
        queryHandlerMapping.addChoiceElement("sql", SQLQueryHandler.class);
        queryHandlerMapping.addChoiceElement("stored-procedure",
            StoredProcedureQueryHandler.class);
        queryHandlerMapping.addChoiceElement("stored-function",
            StoredFunctionQueryHandler.class);
        descriptor.addMapping(queryHandlerMapping);

        return descriptor;
    }
View Full Code Here

                        }
                        addChild(xmlFld.getXPathFragment(), mappingNodeValue, xmlDescriptor.getNamespaceResolver());
                    }
                    continue;
                } else if (xmlMapping instanceof XMLChoiceObjectMapping) {
                    XMLChoiceObjectMapping xmlChoiceMapping = (XMLChoiceObjectMapping)xmlMapping;
                    Iterator fields = xmlChoiceMapping.getChoiceElementMappings().keySet().iterator();
                    XMLField firstField = (XMLField)fields.next();
                    XMLChoiceObjectMappingNodeValue firstNodeValue = new XMLChoiceObjectMappingNodeValue(xmlChoiceMapping, firstField);
                    firstNodeValue.setNullCapableNodeValue(firstNodeValue);
                    this.addNullCapableValue(firstNodeValue);
                    addChild(firstField.getXPathFragment(), firstNodeValue, xmlDescriptor.getNamespaceResolver());
                    while(fields.hasNext()) {
                        XMLField next = (XMLField)fields.next();
                        XMLChoiceObjectMappingNodeValue nodeValue = new XMLChoiceObjectMappingNodeValue(xmlChoiceMapping, next);
                        nodeValue.setNullCapableNodeValue(firstNodeValue);
                        addChild(next.getXPathFragment(), nodeValue, xmlDescriptor.getNamespaceResolver());
                    }
                    continue;
                } else if(xmlMapping instanceof XMLChoiceCollectionMapping) {
                    XMLChoiceCollectionMapping xmlChoiceMapping = (XMLChoiceCollectionMapping)xmlMapping;
                    Iterator fields = xmlChoiceMapping.getChoiceElementMappings().keySet().iterator();
                    XMLField firstField = (XMLField)fields.next();
                    XMLChoiceCollectionMappingUnmarshalNodeValue unmarshalValue = new XMLChoiceCollectionMappingUnmarshalNodeValue(xmlChoiceMapping, firstField);
                    XMLChoiceCollectionMappingMarshalNodeValue marshalValue = new XMLChoiceCollectionMappingMarshalNodeValue(xmlChoiceMapping, firstField);
                    HashMap<XMLField, NodeValue> fieldToNodeValues = new HashMap<XMLField, NodeValue>();
                    unmarshalValue.setContainerNodeValue(unmarshalValue);
View Full Code Here

                        }
                        addChild(xmlFld.getXPathFragment(), mappingNodeValue, xmlDescriptor.getNamespaceResolver());
                    }
                    continue;
                } else if (xmlMapping instanceof XMLChoiceObjectMapping) {
                    XMLChoiceObjectMapping xmlChoiceMapping = (XMLChoiceObjectMapping)xmlMapping;
                    Iterator fields = xmlChoiceMapping.getChoiceElementMappings().keySet().iterator();
                    XMLField firstField = (XMLField)fields.next();
                    XMLChoiceObjectMappingNodeValue firstNodeValue = new XMLChoiceObjectMappingNodeValue(xmlChoiceMapping, firstField);
                    firstNodeValue.setNullCapableNodeValue(firstNodeValue);
                    this.addNullCapableValue(firstNodeValue);
                    addChild(firstField.getXPathFragment(), firstNodeValue, xmlDescriptor.getNamespaceResolver());
                    while(fields.hasNext()) {
                        XMLField next = (XMLField)fields.next();
                        XMLChoiceObjectMappingNodeValue nodeValue = new XMLChoiceObjectMappingNodeValue(xmlChoiceMapping, next);
                        nodeValue.setNullCapableNodeValue(firstNodeValue);
                        addChild(next.getXPathFragment(), nodeValue, xmlDescriptor.getNamespaceResolver());
                    }
                    continue;
                } else if(xmlMapping instanceof XMLChoiceCollectionMapping) {
                    XMLChoiceCollectionMapping xmlChoiceMapping = (XMLChoiceCollectionMapping)xmlMapping;
                    Iterator fields = xmlChoiceMapping.getChoiceElementMappings().keySet().iterator();
                    XMLField firstField = (XMLField)fields.next();
                    XMLChoiceCollectionMappingUnmarshalNodeValue unmarshalValue = new XMLChoiceCollectionMappingUnmarshalNodeValue(xmlChoiceMapping, firstField);
                    XMLChoiceCollectionMappingMarshalNodeValue marshalValue = new XMLChoiceCollectionMappingMarshalNodeValue(xmlChoiceMapping, firstField);
                    HashMap<XMLField, NodeValue> fieldToNodeValues = new HashMap<XMLField, NodeValue>();
                    unmarshalValue.setContainerNodeValue(unmarshalValue);
View Full Code Here

        }
        return mapping;
    }
   
    private DatabaseMapping buildXMLChoiceObjectMapping(String mappingUri) {
        XMLChoiceObjectMapping mapping = new XMLChoiceObjectMapping();
        mapping.setAttributeName(getName());

        //First add XPath for this property
        String xPath = getQualifiedXPath(mappingUri, getType().isDataType());
        mapping.addChoiceElement(xPath, getType().getImplClass());
        //For each substitutable property, create the xpath and add it.
        Iterator<SDOProperty> properties = this.getSubstitutableElements().iterator();
        while(properties.hasNext()) {
            SDOProperty nextProp = properties.next();
            xPath = nextProp.getQualifiedXPath(mappingUri, nextProp.getType().isDataType(), getContainingType());
            mapping.addChoiceElement(xPath, nextProp.getType().getImplClass());
        }
        return mapping;
    }
View Full Code Here

        resultMapping.setAttributeName("result");
        resultMapping.setReferenceClass(Result.class);
        resultMapping.setXPath( "result");
        descriptor.addMapping(resultMapping);

        XMLChoiceObjectMapping queryHandlerMapping = new XMLChoiceObjectMapping();
        queryHandlerMapping.setAttributeName("queryHandler");
        queryHandlerMapping.addChoiceElement("jpql", JPQLQueryHandler.class);
        queryHandlerMapping.addChoiceElement("named-query", NamedQueryHandler.class);
        queryHandlerMapping.addChoiceElement("sql", SQLQueryHandler.class);
        queryHandlerMapping.addChoiceElement("stored-procedure",
            StoredProcedureQueryHandler.class);
        queryHandlerMapping.addChoiceElement("stored-function",
            StoredFunctionQueryHandler.class);
        descriptor.addMapping(queryHandlerMapping);

        return descriptor;
    }
View Full Code Here

        }
        return mapping;
    }
   
    private DatabaseMapping buildXMLChoiceObjectMapping(String mappingUri) {
        XMLChoiceObjectMapping mapping = new XMLChoiceObjectMapping();
        mapping.setAttributeName(getName());

        //First add XPath for this property
        String xPath = getQualifiedXPath(mappingUri, getType().isDataType());
        mapping.addChoiceElement(xPath, ((SDOType)getType()).getImplClass());
        //For each substitutable property, create the xpath and add it.
        Iterator<SDOProperty> properties = this.getSubstitutableElements().iterator();
        while(properties.hasNext()) {
            SDOProperty nextProp = properties.next();
            xPath = nextProp.getQualifiedXPath(mappingUri, nextProp.getType().isDataType(), (SDOType)getContainingType());
            mapping.addChoiceElement(xPath, ((SDOType)nextProp.getType()).getImplClass());
        }
        return mapping;
    }
View Full Code Here

        }
        return mapping;
    }
   
    private DatabaseMapping buildXMLChoiceObjectMapping(String mappingUri) {
        XMLChoiceObjectMapping mapping = new XMLChoiceObjectMapping();
        mapping.setAttributeName(getName());

        //First add XPath for this property
        String xPath = getQualifiedXPath(mappingUri, getType().isDataType());
        mapping.addChoiceElement(xPath, getType().getImplClass());
        //For each substitutable property, create the xpath and add it.
        Iterator<SDOProperty> properties = this.getSubstitutableElements().iterator();
        while(properties.hasNext()) {
            SDOProperty nextProp = properties.next();
            xPath = nextProp.getQualifiedXPath(mappingUri, nextProp.getType().isDataType(), getContainingType());
            mapping.addChoiceElement(xPath, nextProp.getType().getImplClass());
        }
        return mapping;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.oxm.mappings.XMLChoiceObjectMapping

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.