Search in sources :

Example 11 with XMLCompositeDirectCollectionMapping

use of org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping in project eclipselink by eclipse-ee4j.

the class ObjectPersistenceRuntimeXMLProject method buildInterfacePolicyDescriptor.

protected ClassDescriptor buildInterfacePolicyDescriptor() {
    XMLDescriptor descriptor = new XMLDescriptor();
    descriptor.setJavaClass(InterfacePolicy.class);
    descriptor.setDefaultRootElement("interfaces");
    XMLCompositeDirectCollectionMapping parentInterfacesMapping = new XMLCompositeDirectCollectionMapping();
    parentInterfacesMapping.setAttributeElementClass(Class.class);
    parentInterfacesMapping.setAttributeName("parentInterfaces");
    parentInterfacesMapping.setGetMethodName("getParentInterfaces");
    parentInterfacesMapping.setSetMethodName("setParentInterfaces");
    parentInterfacesMapping.setXPath(getPrimaryNamespaceXPath() + "interface/text()");
    descriptor.addMapping(parentInterfacesMapping);
    XMLDirectMapping implementorDescriptorMapping = new XMLDirectMapping();
    implementorDescriptorMapping.setAttributeName("implementorDescriptor");
    implementorDescriptorMapping.setGetMethodName("getImplementorDescriptor");
    implementorDescriptorMapping.setSetMethodName("setImplementorDescriptor");
    implementorDescriptorMapping.setXPath(getPrimaryNamespaceXPath() + "implementor-descriptor/text()");
    descriptor.addMapping(implementorDescriptorMapping);
    return descriptor;
}
Also used : XMLDescriptor(org.eclipse.persistence.oxm.XMLDescriptor) XMLDirectMapping(org.eclipse.persistence.oxm.mappings.XMLDirectMapping) XMLCompositeDirectCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping)

Example 12 with XMLCompositeDirectCollectionMapping

use of org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping in project eclipselink by eclipse-ee4j.

the class ObjectPersistenceRuntimeXMLProject_11_1_1 method buildIsSetNullPolicyDescriptor.

protected ClassDescriptor buildIsSetNullPolicyDescriptor() {
    // The IsSetPerformedForAbsentNode flag is always false on this IsSet mapping
    XMLDescriptor aDescriptor = new XMLDescriptor();
    aDescriptor.setJavaClass(IsSetNullPolicy.class);
    aDescriptor.getInheritancePolicy().setParentClass(AbstractNullPolicy.class);
    XMLDirectMapping isSetMethodNameMapping = new XMLDirectMapping();
    isSetMethodNameMapping.setAttributeName("isSetMethodName");
    isSetMethodNameMapping.setXPath(getPrimaryNamespaceXPath() + "is-set-method-name/text()");
    aDescriptor.addMapping(isSetMethodNameMapping);
    // 20070922: Bug#6039730 - add IsSet capability for 1+ parameters for SDO
    XMLCompositeDirectCollectionMapping isSetParameterTypesMapping = new XMLCompositeDirectCollectionMapping();
    isSetParameterTypesMapping.setAttributeName("isSetParameterTypes");
    isSetParameterTypesMapping.setXPath(getPrimaryNamespaceXPath() + "is-set-parameter-type");
    isSetParameterTypesMapping.setAttributeAccessor(new IsSetNullPolicyIsSetParameterTypesAttributeAccessor());
    aDescriptor.addMapping(isSetParameterTypesMapping);
    XMLCompositeDirectCollectionMapping isSetParametersMapping = new XMLCompositeDirectCollectionMapping();
    isSetParametersMapping.setAttributeName("isSetParameters");
    isSetParametersMapping.setXPath(getPrimaryNamespaceXPath() + "is-set-parameter");
    isSetParametersMapping.setAttributeAccessor(new IsSetNullPolicyIsSetParametersAttributeAccessor());
    aDescriptor.addMapping(isSetParametersMapping);
    return aDescriptor;
}
Also used : XMLDescriptor(org.eclipse.persistence.oxm.XMLDescriptor) XMLDirectMapping(org.eclipse.persistence.oxm.mappings.XMLDirectMapping) XMLCompositeDirectCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping)

Example 13 with XMLCompositeDirectCollectionMapping

use of org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping in project eclipselink by eclipse-ee4j.

the class ObjectPersistenceRuntimeXMLProject method buildXMLUnionFieldDescriptor.

protected ClassDescriptor buildXMLUnionFieldDescriptor() {
    XMLDescriptor descriptor = new XMLDescriptor();
    descriptor.setJavaClass(XMLUnionField.class);
    descriptor.getInheritancePolicy().setParentClass(DatabaseField.class);
    XMLDirectMapping typedFieldMapping = new XMLDirectMapping();
    typedFieldMapping.setAttributeName("isTypedTextField");
    typedFieldMapping.setGetMethodName("isTypedTextField");
    typedFieldMapping.setSetMethodName("setIsTypedTextField");
    typedFieldMapping.setXPath(getPrimaryNamespaceXPath() + "typed-text-field/text()");
    typedFieldMapping.setNullValue(Boolean.FALSE);
    descriptor.addMapping(typedFieldMapping);
    XMLDirectMapping singleNodeMapping = new XMLDirectMapping();
    singleNodeMapping.setAttributeName("usesSingleNode");
    singleNodeMapping.setGetMethodName("usesSingleNode");
    singleNodeMapping.setSetMethodName("setUsesSingleNode");
    singleNodeMapping.setXPath(getPrimaryNamespaceXPath() + "single-node/text()");
    singleNodeMapping.setNullValue(Boolean.FALSE);
    descriptor.addMapping(singleNodeMapping);
    XMLCompositeDirectCollectionMapping schemaTypeMapping = new XMLCompositeDirectCollectionMapping();
    schemaTypeMapping.setAttributeName("schemaTypes");
    schemaTypeMapping.setGetMethodName("getSchemaTypes");
    schemaTypeMapping.setSetMethodName("setSchemaTypes");
    schemaTypeMapping.useCollectionClass(ArrayList.class);
    schemaTypeMapping.setAttributeElementClass(QName.class);
    schemaTypeMapping.setXPath(getPrimaryNamespaceXPath() + "schema-type/text()");
    descriptor.addMapping(schemaTypeMapping);
    XMLCompositeCollectionMapping xmlToJavaPairsMapping = new XMLCompositeCollectionMapping();
    xmlToJavaPairsMapping.setXPath(getPrimaryNamespaceXPath() + "xml-to-java-conversion-pair");
    xmlToJavaPairsMapping.setReferenceClass(XMLConversionPair.class);
    xmlToJavaPairsMapping.useCollectionClass(ArrayList.class);
    xmlToJavaPairsMapping.setAttributeName("userXMLTypes");
    xmlToJavaPairsMapping.setGetMethodName("getUserXMLTypesForDeploymentXML");
    xmlToJavaPairsMapping.setSetMethodName("setUserXMLTypesForDeploymentXML");
    descriptor.addMapping(xmlToJavaPairsMapping);
    XMLCompositeCollectionMapping javaToXMLPairsMapping = new XMLCompositeCollectionMapping();
    javaToXMLPairsMapping.setXPath(getPrimaryNamespaceXPath() + "java-to-xml-conversion-pair");
    javaToXMLPairsMapping.useCollectionClass(ArrayList.class);
    javaToXMLPairsMapping.setReferenceClass(XMLConversionPair.class);
    javaToXMLPairsMapping.setAttributeName("userJavaTypes");
    javaToXMLPairsMapping.setGetMethodName("getUserJavaTypesForDeploymentXML");
    javaToXMLPairsMapping.setSetMethodName("setUserJavaTypesForDeploymentXML");
    descriptor.addMapping(javaToXMLPairsMapping);
    return descriptor;
}
Also used : XMLDescriptor(org.eclipse.persistence.oxm.XMLDescriptor) XMLDirectMapping(org.eclipse.persistence.oxm.mappings.XMLDirectMapping) XMLCompositeCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLCompositeCollectionMapping) XMLCompositeDirectCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping)

Example 14 with XMLCompositeDirectCollectionMapping

use of org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping in project eclipselink by eclipse-ee4j.

the class ObjectPersistenceRuntimeXMLProject method buildFetchGroupDescriptor.

protected ClassDescriptor buildFetchGroupDescriptor() {
    XMLDescriptor descriptor = new XMLDescriptor();
    descriptor.setJavaClass(FetchGroup.class);
    descriptor.setDefaultRootElement("fetch-group");
    XMLDirectMapping fetchGroupNameMapping = new XMLDirectMapping();
    fetchGroupNameMapping.setAttributeName("name");
    fetchGroupNameMapping.setXPath(getPrimaryNamespaceXPath() + "name");
    descriptor.addMapping(fetchGroupNameMapping);
    XMLCompositeDirectCollectionMapping fetchGroupAttributeMapping = new XMLCompositeDirectCollectionMapping();
    CollectionContainerPolicy containerPolicy = new CollectionContainerPolicy(TreeSet.class);
    fetchGroupAttributeMapping.setContainerPolicy(containerPolicy);
    fetchGroupAttributeMapping.setAttributeName("attributes");
    fetchGroupAttributeMapping.setGetMethodName("getAttributeNames");
    fetchGroupAttributeMapping.setSetMethodName("setAttributeNames");
    fetchGroupAttributeMapping.setXPath(getPrimaryNamespaceXPath() + "fetch-group-attributes/" + getPrimaryNamespaceXPath() + "fetch-group-attribute/text()");
    descriptor.addMapping(fetchGroupAttributeMapping);
    return descriptor;
}
Also used : XMLDescriptor(org.eclipse.persistence.oxm.XMLDescriptor) CollectionContainerPolicy(org.eclipse.persistence.internal.queries.CollectionContainerPolicy) XMLDirectMapping(org.eclipse.persistence.oxm.mappings.XMLDirectMapping) XMLCompositeDirectCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping)

Example 15 with XMLCompositeDirectCollectionMapping

use of org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping in project eclipselink by eclipse-ee4j.

the class ObjectPersistenceRuntimeXMLProject method buildOXXMLDescriptorDescriptor.

protected ClassDescriptor buildOXXMLDescriptorDescriptor() {
    XMLDescriptor descriptor = new XMLDescriptor();
    descriptor.setJavaClass(XMLDescriptor.class);
    descriptor.descriptorIsAggregate();
    descriptor.getInheritancePolicy().setParentClass(ClassDescriptor.class);
    XMLCompositeDirectCollectionMapping defaultRootElementMapping = new XMLCompositeDirectCollectionMapping();
    defaultRootElementMapping.setAttributeName("defaultRootElement");
    defaultRootElementMapping.setGetMethodName("getTableNames");
    defaultRootElementMapping.setSetMethodName("setTableNames");
    defaultRootElementMapping.setXPath(getPrimaryNamespaceXPath() + "default-root-element/text()");
    descriptor.addMapping(defaultRootElementMapping);
    XMLDirectMapping shouldPreserveDocument = new XMLDirectMapping();
    shouldPreserveDocument.setAttributeName("shouldPreserveDocument");
    shouldPreserveDocument.setGetMethodName("shouldPreserveDocument");
    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;
}
Also used : XMLDescriptor(org.eclipse.persistence.oxm.XMLDescriptor) XMLDirectMapping(org.eclipse.persistence.oxm.mappings.XMLDirectMapping) XMLCompositeDirectCollectionMapping(org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping) XMLCompositeObjectMapping(org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping)

Aggregations

XMLCompositeDirectCollectionMapping (org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping)63 XMLDescriptor (org.eclipse.persistence.oxm.XMLDescriptor)49 XMLDirectMapping (org.eclipse.persistence.oxm.mappings.XMLDirectMapping)40 XMLField (org.eclipse.persistence.oxm.XMLField)14 XMLCompositeCollectionMapping (org.eclipse.persistence.oxm.mappings.XMLCompositeCollectionMapping)11 XMLCompositeObjectMapping (org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping)11 NamespaceResolver (org.eclipse.persistence.oxm.NamespaceResolver)10 QName (javax.xml.namespace.QName)6 DatabaseMapping (org.eclipse.persistence.mappings.DatabaseMapping)6 ClassDescriptor (org.eclipse.persistence.descriptors.ClassDescriptor)3 DescriptorException (org.eclipse.persistence.exceptions.DescriptorException)3 JAXBException (org.eclipse.persistence.exceptions.JAXBException)3 DatabaseField (org.eclipse.persistence.internal.helper.DatabaseField)3 JAXBArrayAttributeAccessor (org.eclipse.persistence.internal.jaxb.many.JAXBArrayAttributeAccessor)3 Field (org.eclipse.persistence.internal.oxm.mappings.Field)3 JavaClass (org.eclipse.persistence.jaxb.javamodel.JavaClass)3 BigDecimal (java.math.BigDecimal)2 CoreDescriptor (org.eclipse.persistence.core.descriptors.CoreDescriptor)2 CoreMapping (org.eclipse.persistence.core.mappings.CoreMapping)2 CoreConverter (org.eclipse.persistence.core.mappings.converters.CoreConverter)2