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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations