Package org.eclipse.persistence.oxm.mappings

Examples of org.eclipse.persistence.oxm.mappings.XMLChoiceObjectMapping.addChoiceElement()


                if (next.getXmlPath() != null) {
                    srcXPath = new XMLField(next.getXmlPath());
                } else {
                    srcXPath = getXPathForField(next, namespace, true);
                }
                mapping.addChoiceElement(srcXPath.getXPath(), type.getQualifiedName(), tgtXPath);
            } else {
                XMLField xpath;
                if (next.getXmlPath() != null) {
                    xpath = new XMLField(next.getXmlPath());
                } else {
View Full Code Here


                if (next.getXmlPath() != null) {
                    xpath = new XMLField(next.getXmlPath());
                } else {
                    xpath = getXPathForField(next, namespace, (!(this.typeInfo.containsKey(type.getQualifiedName()))) || next.isMtomAttachment());
                }
                mapping.addChoiceElement(xpath.getName(), type.getQualifiedName(), false);
            }
        }
        return mapping;
    }
View Full Code Here

                    listConverter.setObjectClassName(element.getJavaType().getQualifiedName());
                    ((XMLCompositeDirectCollectionMapping)nestedMapping).setValueConverter(listConverter);
                }
            } else {
                XMLChoiceObjectMapping xmlChoiceObjectMapping = (XMLChoiceObjectMapping) mapping;
                xmlChoiceObjectMapping.addChoiceElement(xmlField, element.getJavaTypeName());
                nestedMapping = (DatabaseMapping) xmlChoiceObjectMapping.getChoiceElementMappings().get(xmlField);
                if(nestedMapping.isAbstractCompositeObjectMapping()){
                    ((XMLCompositeObjectMapping)nestedMapping).setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT);
                }
            }
View Full Code Here

        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());
View Full Code Here

        //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;
    }
   
    private DatabaseMapping buildXMLChoiceCollectionMapping(String mappingUri) {
View Full Code Here

                if (jaxbMapping.isAbstractCompositeObjectMapping()) {
                    XMLChoiceObjectMapping xmlChoiceMapping = new XMLChoiceObjectMapping();
                    xmlChoiceMapping.setAttributeName(attributeName);
                    copyAccessorToMapping(jaxbMapping, xmlChoiceMapping);
                    xmlChoiceMapping.setProperties(jaxbMapping.getProperties());
                    xmlChoiceMapping.addChoiceElement(attributeName, jpaMapping.getReferenceDescriptor().getJavaClass());
                    xmlChoiceMapping.addChoiceElement(attributeName, Link.class);
                    xmlChoiceMapping.setConverter(new XMLJavaTypeConverter(Class.forName(adapterClassName, true, cl)));
                    jaxbDescriptor.removeMappingForAttributeName(jaxbMapping.getAttributeName());
                    jaxbDescriptor.addMapping(xmlChoiceMapping);
                } else if (jaxbMapping.isAbstractCompositeCollectionMapping()) {
View Full Code Here

                    XMLChoiceObjectMapping xmlChoiceMapping = new XMLChoiceObjectMapping();
                    xmlChoiceMapping.setAttributeName(attributeName);
                    copyAccessorToMapping(jaxbMapping, xmlChoiceMapping);
                    xmlChoiceMapping.setProperties(jaxbMapping.getProperties());
                    xmlChoiceMapping.addChoiceElement(attributeName, jpaMapping.getReferenceDescriptor().getJavaClass());
                    xmlChoiceMapping.addChoiceElement(attributeName, Link.class);
                    xmlChoiceMapping.setConverter(new XMLJavaTypeConverter(Class.forName(adapterClassName, true, cl)));
                    jaxbDescriptor.removeMappingForAttributeName(jaxbMapping.getAttributeName());
                    jaxbDescriptor.addMapping(xmlChoiceMapping);
                } else if (jaxbMapping.isAbstractCompositeCollectionMapping()) {
                    XMLChoiceCollectionMapping xmlChoiceMapping = new XMLChoiceCollectionMapping();
View Full Code Here

                } else if (jaxbMapping.isAbstractCompositeCollectionMapping()) {
                    XMLChoiceCollectionMapping xmlChoiceMapping = new XMLChoiceCollectionMapping();
                    xmlChoiceMapping.setAttributeName(attributeName);
                    copyAccessorToMapping(jaxbMapping, xmlChoiceMapping);
                    xmlChoiceMapping.setProperties(jaxbMapping.getProperties());
                    xmlChoiceMapping.addChoiceElement(attributeName, Link.class);
                    xmlChoiceMapping.addChoiceElement(attributeName, jpaMapping.getReferenceDescriptor().getJavaClass());
                    xmlChoiceMapping.setConverter(new XMLJavaTypeConverter(Class.forName(adapterClassName, true, cl)));
                    jaxbDescriptor.removeMappingForAttributeName(jaxbMapping.getAttributeName());
                    jaxbDescriptor.addMapping(xmlChoiceMapping);
                }
View Full Code Here

                    XMLChoiceCollectionMapping xmlChoiceMapping = new XMLChoiceCollectionMapping();
                    xmlChoiceMapping.setAttributeName(attributeName);
                    copyAccessorToMapping(jaxbMapping, xmlChoiceMapping);
                    xmlChoiceMapping.setProperties(jaxbMapping.getProperties());
                    xmlChoiceMapping.addChoiceElement(attributeName, Link.class);
                    xmlChoiceMapping.addChoiceElement(attributeName, jpaMapping.getReferenceDescriptor().getJavaClass());
                    xmlChoiceMapping.setConverter(new XMLJavaTypeConverter(Class.forName(adapterClassName, true, cl)));
                    jaxbDescriptor.removeMappingForAttributeName(jaxbMapping.getAttributeName());
                    jaxbDescriptor.addMapping(xmlChoiceMapping);
                }
            } catch (ClassNotFoundException e) {
View Full Code Here

        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",
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.