Package org.eclipse.persistence.oxm.mappings

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


    protected ClassDescriptor buildAssociationDescriptor() {
        XMLDescriptor descriptor = new XMLDescriptor();
        descriptor.setJavaClass(Association.class);
        descriptor.setDefaultRootElement("field-reference");

        XMLCompositeObjectMapping keyMapping = new XMLCompositeObjectMapping();
        keyMapping.setAttributeName("key");
        keyMapping.setGetMethodName("getKey");
        keyMapping.setSetMethodName("setKey");
        keyMapping.setXPath(getSecondaryNamespaceXPath() + "source-field");
        keyMapping.setReferenceClass(DatabaseField.class);
        descriptor.addMapping(keyMapping);

        XMLCompositeObjectMapping valueMapping = new XMLCompositeObjectMapping();
        valueMapping.setAttributeName("value");
        valueMapping.setGetMethodName("getValue");
        valueMapping.setSetMethodName("setValue");
        valueMapping.setXPath(getSecondaryNamespaceXPath() + "target-field");
        valueMapping.setReferenceClass(DatabaseField.class);
        descriptor.addMapping(valueMapping);

        return descriptor;
    }
View Full Code Here


    protected ClassDescriptor buildFieldTranslationDescriptor() {
        XMLDescriptor descriptor = new XMLDescriptor();
        descriptor.setJavaClass(FieldTranslation.class);
        descriptor.setDefaultRootElement("field-translation");

        XMLCompositeObjectMapping keyMapping = new XMLCompositeObjectMapping();
        keyMapping.setAttributeName("key");
        keyMapping.setGetMethodName("getKey");
        keyMapping.setSetMethodName("setKey");
        keyMapping.setXPath(getPrimaryNamespaceXPath() + "source-field");
        keyMapping.setReferenceClass(DatabaseField.class);
        descriptor.addMapping(keyMapping);

        XMLCompositeObjectMapping valueMapping = new XMLCompositeObjectMapping();
        valueMapping.setAttributeName("value");
        valueMapping.setGetMethodName("getValue");
        valueMapping.setSetMethodName("setValue");
        valueMapping.setXPath(getPrimaryNamespaceXPath() + "target-field");
        valueMapping.setReferenceClass(DatabaseField.class);
        descriptor.addMapping(valueMapping);

        return descriptor;
    }
View Full Code Here

        descriptor.getInheritancePolicy().setShouldReadSubclasses(true);
        descriptor.getInheritancePolicy().addClassIndicator(FieldTransformation.class, getPrimaryNamespaceXPath() + "field-transformation");
        descriptor.getInheritancePolicy().addClassIndicator(MethodBasedFieldTransformation.class, getPrimaryNamespaceXPath() + "method-based-field-transformation");
        descriptor.getInheritancePolicy().addClassIndicator(TransformerBasedFieldTransformation.class, getPrimaryNamespaceXPath() + "transformer-based-field-transformation");

        XMLCompositeObjectMapping fieldMapping = new XMLCompositeObjectMapping();
        fieldMapping.setAttributeName("field");
        fieldMapping.setReferenceClass(DatabaseField.class);
        fieldMapping.setXPath(getPrimaryNamespaceXPath() + "field");
        fieldMapping.setGetMethodName("getField");
        fieldMapping.setSetMethodName("setField");

        descriptor.addMapping(fieldMapping);

        return descriptor;
    }
View Full Code Here

        descriptorsMapping.setGetMethodName("getOrderedDescriptors");
        descriptorsMapping.setReferenceClass(ClassDescriptor.class);
        descriptorsMapping.setXPath(getSecondaryNamespaceXPath() + "class-mapping-descriptors/" + getSecondaryNamespaceXPath() + "class-mapping-descriptor");
        descriptor.addMapping(descriptorsMapping);

        XMLCompositeObjectMapping loginMapping = new XMLCompositeObjectMapping();
        loginMapping.setSetMethodName("setDatasourceLogin");
        loginMapping.setGetMethodName("getDatasourceLogin");
        loginMapping.setAttributeName("login");
        loginMapping.setReferenceClass(DatasourceLogin.class);
        loginMapping.setXPath(getPrimaryNamespaceXPath() + "login");
        descriptor.addMapping(loginMapping);

        return descriptor;
    }
View Full Code Here

    }
   
    protected ClassDescriptor buildXMLChoiceFieldToClassAssociationDescriptor() {
        ClassDescriptor descriptor = super.buildXMLChoiceFieldToClassAssociationDescriptor();
       
        XMLCompositeObjectMapping converterMapping = new XMLCompositeObjectMapping();
        converterMapping.setAttributeName("converter");
        converterMapping.setXPath(getPrimaryNamespacePrefix() + "value-converter");
        converterMapping.setReferenceClass(Converter.class);
       
        descriptor.addMapping(converterMapping);
       
        return descriptor;
    }
View Full Code Here

    /**
      * INTERNAL:
      */
    public void buildChangeSummaryMapping() {
        XMLCompositeObjectMapping aCMapping = new XMLCompositeObjectMapping();
        aCMapping.setAttributeName(getName());
        String xpath = getQualifiedXPath(getContainingType().getURI(), false);

        aCMapping.setXPath(xpath);
        aCMapping.setGetMethodName("getChangeSummary");
        aCMapping.setSetMethodName("_setChangeSummary");
        aCMapping.setReferenceClass(SDOChangeSummary.class);
        // Handle nillable element support via the nullable property
        if (nullable) {
            setIsSetNillablePolicyOnMapping(aCMapping, propertyName);
        } else {
            // elements or attributes
View Full Code Here

        setIsSetNillablePolicyOnMapping(mapping, propertyName);
        return mapping;
    }

    private DatabaseMapping buildXMLCompositeObjectMapping(String mappingUri) {
        XMLCompositeObjectMapping mapping = new XMLCompositeObjectMapping();
        mapping.setAttributeName(getName());
        String xpath = getQualifiedXPath(mappingUri, false);

        mapping.setXPath(xpath);

        if (!getType().isDataObjectType()) {
            QName schemaContext = ((SDOType)getType()).getXmlDescriptor().getSchemaReference().getSchemaContextAsQName(((SDOType)getType()).getXmlDescriptor().getNamespaceResolver());
            ((XMLField)mapping.getField()).setLeafElementType(schemaContext);
            mapping.setReferenceClassName(((SDOType)getType()).getImplClassName());
            mapping.setReferenceClass(((SDOType)getType()).getImplClass());
        }else{
            if(getXsdType()!= null){              
              ((XMLField)mapping.getField()).setLeafElementType(getXsdType());
            }
        }

        // Handle nillable element support via the nullable property
        if (nullable) {
View Full Code Here

                                typeDescriptor.getNamespaceResolver().getDefaultNamespaceURI());
                            descriptor.addMapping(mapping);
                            mapping.initialize((AbstractSession)dbwsAdapter.getOXSession());
                        }
                        else {
                            XMLCompositeObjectMapping mapping = new XMLCompositeObjectMapping();
                            mapping.setAttributeName("result");
                            mapping.setReferenceClass(typeDescriptor.getJavaClass());
                            mapping.setXPath(SERVICE_NAMESPACE_PREFIX + ":" + "result/" + localElement);
                            descriptor.getNamespaceResolver().setDefaultNamespaceURI(
                                typeDescriptor.getNamespaceResolver().getDefaultNamespaceURI());
                            descriptor.addMapping(mapping);
                            mapping.initialize((AbstractSession)dbwsAdapter.getOXSession());
                        }
                    }
                    else {
                        if (type.equals(new QName(W3C_XML_SCHEMA_NS_URI, "any"))) {
                            XMLAnyObjectMapping mapping = new XMLAnyObjectMapping();
                            mapping.setAttributeName("result");
                            mapping.setXPath(SERVICE_NAMESPACE_PREFIX + ":" + "result");
                            descriptor.addMapping(mapping);
                        }
                        else if (type.equals(new QName(W3C_XML_SCHEMA_NS_URI, BASE_64_BINARY))) {
                            XMLBinaryDataMapping mapping = new XMLBinaryDataMapping();
                            mapping.setAttributeName("result");
                            mapping.setXPath(SERVICE_NAMESPACE_PREFIX + ":" + "result");
                            mapping.setShouldInlineBinaryData(true);
                            ((XMLField)mapping.getField()).setSchemaType(type);
                            descriptor.addMapping(mapping);
                        }
                        else {
                            XMLDirectMapping mapping = new XMLDirectMapping();
                            mapping.setAttributeName("result");
                            mapping.setXPath(SERVICE_NAMESPACE_PREFIX + ":" + "result/text()");
                            descriptor.addMapping(mapping);
                        }
                    }
                }
            }
View Full Code Here

     */
    protected ClassDescriptor buildAttributesDescriptor() {
        XMLDescriptor descriptor = new XMLDescriptor();
        descriptor.setJavaClass(XMLAttributes.class);
       
        XMLCompositeObjectMapping embeddedIdMapping = new XMLCompositeObjectMapping();
        embeddedIdMapping.setAttributeName("m_embeddedId");
        embeddedIdMapping.setGetMethodName("getEmbeddedId");
        embeddedIdMapping.setSetMethodName("setEmbeddedId");
        embeddedIdMapping.setReferenceClass(EmbeddedIdAccessor.class);
        embeddedIdMapping.setXPath("orm:embedded-id");
        descriptor.addMapping(embeddedIdMapping);
       
        XMLCompositeCollectionMapping idsMapping = new XMLCompositeCollectionMapping();
        idsMapping.setAttributeName("m_ids");
        idsMapping.setGetMethodName("getIds");
View Full Code Here

    protected ClassDescriptor buildBasicMapDescriptor() {
        XMLDescriptor descriptor = new XMLDescriptor();
        descriptor.setJavaClass(BasicMapAccessor.class);
       
        // Element mappings - must remain in order of definition in XML.
        XMLCompositeObjectMapping keyColumnMapping = new XMLCompositeObjectMapping();
        keyColumnMapping.setAttributeName("m_keyColumn");
        keyColumnMapping.setGetMethodName("getKeyColumn");
        keyColumnMapping.setSetMethodName("setKeyColumn");
        keyColumnMapping.setReferenceClass(ColumnMetadata.class);
        keyColumnMapping.setXPath("orm:key-column");
        descriptor.addMapping(keyColumnMapping);
       
        XMLDirectMapping keyConverterMapping = new XMLDirectMapping();
        keyConverterMapping.setAttributeName("m_keyConverter");
        keyConverterMapping.setGetMethodName("getKeyConverter");
View Full Code Here

TOP

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

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.