Package org.eclipse.persistence.oxm.mappings

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


        shouldPreserveDocument.setSetMethodName("setShouldPreserveDocument");
        shouldPreserveDocument.setNullValue(Boolean.FALSE);
        shouldPreserveDocument.setXPath(getPrimaryNamespaceXPath() + "should-preserve-document/text()");
        descriptor.addMapping(shouldPreserveDocument);

        XMLCompositeObjectMapping namespaceResolverMapping = new XMLCompositeObjectMapping();
        namespaceResolverMapping.setXPath(getPrimaryNamespaceXPath() + "namespace-resolver");
        namespaceResolverMapping.setAttributeName("namespaceResolver");
        namespaceResolverMapping.setGetMethodName("getNamespaceResolver");
        namespaceResolverMapping.setSetMethodName("setNamespaceResolver");
        namespaceResolverMapping.setReferenceClass(NamespaceResolver.class);
        descriptor.addMapping(namespaceResolverMapping);

        XMLCompositeObjectMapping schemaReferenceMapping = new XMLCompositeObjectMapping();
        schemaReferenceMapping.setAttributeName("schemaReference");
        schemaReferenceMapping.setXPath(getPrimaryNamespaceXPath() + "schema");
        schemaReferenceMapping.setReferenceClass(XMLSchemaReference.class);
        descriptor.addMapping(schemaReferenceMapping);

        return descriptor;
    }
View Full Code Here


        nonDeferredCreateTimeMapping.setConverter(nonDeferredCreateTimeConverter);
        nonDeferredCreateTimeMapping.setXPath(getPrimaryNamespaceXPath() + "non-deferred-create-time/text()");
        nonDeferredCreateTimeMapping.setNullValue(new Integer(CMPPolicy.UNDEFINED));
        descriptor.addMapping(nonDeferredCreateTimeMapping);

        XMLCompositeObjectMapping pessimisticLockingPolicyMapping = new XMLCompositeObjectMapping();
        pessimisticLockingPolicyMapping.setAttributeName("pessimisticLockingPolicy");
        pessimisticLockingPolicyMapping.setGetMethodName("getPessimisticLockingPolicy");
        pessimisticLockingPolicyMapping.setSetMethodName("setPessimisticLockingPolicy");
        pessimisticLockingPolicyMapping.setReferenceClass(PessimisticLockingPolicy.class);
        pessimisticLockingPolicyMapping.setXPath(getPrimaryNamespaceXPath() + "pessimistic-locking");
        descriptor.addMapping(pessimisticLockingPolicyMapping);

        return descriptor;
    }
View Full Code Here

    protected ClassDescriptor buildFetchGroupManagerDescriptor() {
        XMLDescriptor descriptor = new XMLDescriptor();
        descriptor.setJavaClass(FetchGroupManager.class);

        XMLCompositeObjectMapping defaultFetchGroupMapping = new XMLCompositeObjectMapping();
        defaultFetchGroupMapping.setAttributeName("defaultFetchGroup");
        defaultFetchGroupMapping.setReferenceClass(FetchGroup.class);
        defaultFetchGroupMapping.setXPath(getPrimaryNamespaceXPath() + "default-fetch-group");
        descriptor.addMapping(defaultFetchGroupMapping);

        XMLCompositeCollectionMapping fetchGroupManagerMapping = new XMLCompositeCollectionMapping();
        fetchGroupManagerMapping.setAttributeName("fetchGroups");
        fetchGroupManagerMapping.setReferenceClass(FetchGroup.class);
View Full Code Here

        queryTimeoutMapping.setSetMethodName("setQueryTimeout");
        queryTimeoutMapping.setXPath(getPrimaryNamespaceXPath() + "timeout/text()");
        queryTimeoutMapping.setNullValue(new Integer(DescriptorQueryManager.DefaultTimeout));
        descriptor.addMapping(queryTimeoutMapping);

        XMLCompositeObjectMapping insertQueryMapping = new XMLCompositeObjectMapping();
        insertQueryMapping.setAttributeName("insertQuery");
        insertQueryMapping.setGetMethodName("getInsertQuery");
        insertQueryMapping.setSetMethodName("setInsertQuery");
        insertQueryMapping.setXPath(getPrimaryNamespaceXPath() + "insert-query");
        insertQueryMapping.setReferenceClass(InsertObjectQuery.class);
        descriptor.addMapping(insertQueryMapping);

        XMLCompositeObjectMapping updateQueryMapping = new XMLCompositeObjectMapping();
        updateQueryMapping.setAttributeName("updateQuery");
        updateQueryMapping.setGetMethodName("getUpdateQuery");
        updateQueryMapping.setSetMethodName("setUpdateQuery");
        updateQueryMapping.setXPath(getPrimaryNamespaceXPath() + "update-query");
        updateQueryMapping.setReferenceClass(UpdateObjectQuery.class);
        descriptor.addMapping(updateQueryMapping);

        XMLCompositeObjectMapping deleteQueryMapping = new XMLCompositeObjectMapping();
        deleteQueryMapping.setAttributeName("deleteQuery");
        deleteQueryMapping.setGetMethodName("getDeleteQuery");
        deleteQueryMapping.setSetMethodName("setDeleteQuery");
        deleteQueryMapping.setXPath(getPrimaryNamespaceXPath() + "delete-query");
        deleteQueryMapping.setReferenceClass(DeleteObjectQuery.class);
        descriptor.addMapping(deleteQueryMapping);

        XMLCompositeObjectMapping doesExistQueryMapping = new XMLCompositeObjectMapping();
        doesExistQueryMapping.setAttributeName("doesExistQuery");
        // Handle translation of default does-exist to null.
        doesExistQueryMapping.setAttributeAccessor(new AttributeAccessor() {
            public Object getAttributeValueFromObject(Object object) {
                DoesExistQuery query = ((DescriptorQueryManager)object).getDoesExistQuery();
                if ((!query.isCallQuery()) && query.shouldCheckCacheForDoesExist()) {
                    return null;
                }
                return query;
            }

            public void setAttributeValueInObject(Object object, Object value) {
                DoesExistQuery query = (DoesExistQuery)value;
                if (value == null) {
                    return;
                }
                ((DescriptorQueryManager)object).setDoesExistQuery(query);
            }
        });
        doesExistQueryMapping.setXPath(getPrimaryNamespaceXPath() + "does-exist-query");
        doesExistQueryMapping.setReferenceClass(DoesExistQuery.class);
        descriptor.addMapping(doesExistQueryMapping);

        XMLCompositeObjectMapping readObjectQueryMapping = new XMLCompositeObjectMapping();
        readObjectQueryMapping.setAttributeName("readObjectQuery");
        readObjectQueryMapping.setGetMethodName("getReadObjectQuery");
        readObjectQueryMapping.setSetMethodName("setReadObjectQuery");
        readObjectQueryMapping.setXPath(getPrimaryNamespaceXPath() + "read-object-query");
        readObjectQueryMapping.setReferenceClass(ReadObjectQuery.class);
        descriptor.addMapping(readObjectQueryMapping);

        XMLCompositeObjectMapping readAllQueryMapping = new XMLCompositeObjectMapping();
        readAllQueryMapping.setAttributeName("readAllQuery");
        readAllQueryMapping.setGetMethodName("getReadAllQuery");
        readAllQueryMapping.setSetMethodName("setReadAllQuery");
        readAllQueryMapping.setXPath(getPrimaryNamespaceXPath() + "read-all-query");
        readAllQueryMapping.setReferenceClass(ReadAllQuery.class);
        descriptor.addMapping(readAllQueryMapping);

        return descriptor;
    }
View Full Code Here

        XMLDescriptor descriptor = new XMLDescriptor();
        descriptor.setJavaClass(ReferenceMapping.class);

        descriptor.getInheritancePolicy().setParentClass(ObjectReferenceMapping.class);

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

        return descriptor;
    }
View Full Code Here

        referenceClassMapping.setGetMethodName("getReferenceClass");
        referenceClassMapping.setSetMethodName("setReferenceClass");
        referenceClassMapping.setXPath(getPrimaryNamespaceXPath() + "reference-class/text()");
        descriptor.addMapping(referenceClassMapping);

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

        XMLDirectMapping sourceMapping1 = new XMLDirectMapping();
        sourceMapping1.setAttributeName("isInsert");
        sourceMapping1.setGetMethodName("isInsert");
View Full Code Here

        XMLDescriptor descriptor = new XMLDescriptor();
        descriptor.setJavaClass(AbstractCompositeCollectionMapping.class);

        descriptor.getInheritancePolicy().setParentClass(AggregateMapping.class);

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

        XMLCompositeObjectMapping containerPolicyMapping = new XMLCompositeObjectMapping();
        containerPolicyMapping.setAttributeName("collectionPolicy");
        containerPolicyMapping.setGetMethodName("getContainerPolicy");
        containerPolicyMapping.setSetMethodName("setContainerPolicy");
        containerPolicyMapping.setReferenceClass(ContainerPolicy.class);
        containerPolicyMapping.setXPath(getPrimaryNamespaceXPath() + "container");
        descriptor.addMapping(containerPolicyMapping);

        return descriptor;
    }
View Full Code Here

        XMLDescriptor descriptor = new XMLDescriptor();
        descriptor.setJavaClass(XMLAnyCollectionMapping.class);

        descriptor.getInheritancePolicy().setParentClass(DatabaseMapping.class);

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

        XMLCompositeObjectMapping containerPolicyMapping = new XMLCompositeObjectMapping();
        containerPolicyMapping.setAttributeName("collectionPolicy");
        containerPolicyMapping.setGetMethodName("getContainerPolicy");
        containerPolicyMapping.setSetMethodName("setContainerPolicy");
        containerPolicyMapping.setReferenceClass(ContainerPolicy.class);
        containerPolicyMapping.setXPath(getPrimaryNamespaceXPath() + "container");
        descriptor.addMapping(containerPolicyMapping);

        return descriptor;
    }
View Full Code Here

    protected ClassDescriptor buildAbstractCompositeObjectMappingDescriptor() {
        XMLDescriptor descriptor = new XMLDescriptor();
        descriptor.setJavaClass(AbstractCompositeObjectMapping.class);
        descriptor.getInheritancePolicy().setParentClass(AggregateMapping.class);

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

        return descriptor;
    }
View Full Code Here

    protected ClassDescriptor buildXMLAnyObjectMappingDescriptor() {
        XMLDescriptor descriptor = new XMLDescriptor();
        descriptor.setJavaClass(XMLAnyObjectMapping.class);
        descriptor.getInheritancePolicy().setParentClass(DatabaseMapping.class);

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

        return descriptor;
    }
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.