public ClassDescriptor buildDatabaseLoginConfigDescriptor() { ClassDescriptor descriptor = super.buildDatabaseLoginConfigDescriptor(); XMLDirectMapping bindAllParametersMapping = (XMLDirectMapping) descriptor.getMappingForAttributeName("m_bindAllParameters"); bindAllParametersMapping.setNullValue(Boolean.valueOf(BIND_ALL_PARAMETERS_DEFAULT)); XMLDirectMapping validateConnectionHealthOnErrorMapping = new XMLDirectMapping(); validateConnectionHealthOnErrorMapping.setAttributeName("connectionHealthValidatedOnError"); validateConnectionHealthOnErrorMapping.setGetMethodName("isConnectionHealthValidatedOnError"); validateConnectionHealthOnErrorMapping.setSetMethodName("setConnectionHealthValidatedOnError"); validateConnectionHealthOnErrorMapping.setXPath("connection-health-validated-on-error/text()"); validateConnectionHealthOnErrorMapping.setNullPolicy(new NullPolicy(null, false, false, false)); validateConnectionHealthOnErrorMapping.setNullValue(true); descriptor.addMapping(validateConnectionHealthOnErrorMapping); XMLDirectMapping delayBetweenReconnectAttempts = new XMLDirectMapping(); delayBetweenReconnectAttempts.setAttributeName("delayBetweenConnectionAttempts"); delayBetweenReconnectAttempts.setGetMethodName("getDelayBetweenConnectionAttempts"); delayBetweenReconnectAttempts.setSetMethodName("setDelayBetweenConnectionAttempts"); delayBetweenReconnectAttempts.setXPath("delay-between-reconnect-attempts/text()"); delayBetweenReconnectAttempts.setNullPolicy(new NullPolicy(null, false, false, false)); descriptor.addMapping(delayBetweenReconnectAttempts); XMLDirectMapping queryRetryAttemptCount = new XMLDirectMapping(); queryRetryAttemptCount.setAttributeName("queryRetryAttemptCount"); queryRetryAttemptCount.setGetMethodName("getQueryRetryAttemptCount"); queryRetryAttemptCount.setSetMethodName("setQueryRetryAttemptCount"); queryRetryAttemptCount.setXPath("query-retry-attempt-count/text()"); queryRetryAttemptCount.setNullPolicy(new NullPolicy(null, false, false, false)); descriptor.addMapping(queryRetryAttemptCount); XMLDirectMapping pingSQLMapping = new XMLDirectMapping(); pingSQLMapping.setAttributeName("pingSQL"); pingSQLMapping.setGetMethodName("getPingSQL"); pingSQLMapping.setSetMethodName("setPingSQL"); pingSQLMapping.setXPath("ping-sql/text()"); pingSQLMapping.setNullPolicy(new NullPolicy(null, false, false, false)); descriptor.addMapping(pingSQLMapping); return descriptor; }
// Persistence public static XMLDescriptor buildDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(MWLiteralArgument.class); descriptor.getInheritancePolicy().setParentClass(MWArgument.class); // 1:1 - type XMLCompositeObjectMapping typeMapping = new XMLCompositeObjectMapping(); typeMapping.setAttributeName("type"); typeMapping.setReferenceClass(MWTypeDeclaration.class); typeMapping.setXPath("type"); descriptor.addMapping(typeMapping); // DTF Object value XMLDirectMapping valueMapping = (XMLDirectMapping) descriptor.addDirectMapping("value", "value/text()"); valueMapping.setNullValue(""); return descriptor; }
public static XMLDescriptor legacy60BuildDescriptor() { XMLDescriptor descriptor = MWModel.legacy60BuildStandardDescriptor(); descriptor.setJavaClass(MWTypeDeclaration.class); // 'type' will never be null XMLCompositeObjectMapping typeHandleMapping = new XMLCompositeObjectMapping(); typeHandleMapping.setAttributeName("typeHandle"); typeHandleMapping.setReferenceClass(MWClassHandle.class); typeHandleMapping.setGetMethodName("getTypeHandleForTopLink"); typeHandleMapping.setSetMethodName("setTypeHandleForTopLink"); typeHandleMapping.setXPath("type-handle"); descriptor.addMapping(typeHandleMapping); XMLDirectMapping dimMapping = (XMLDirectMapping) descriptor.addDirectMapping("dimensionality", "dimensionality/text()"); dimMapping.setNullValue(new Integer(0)); return descriptor; }
public ClassDescriptor buildXMLLoginConfigDescriptor() { ClassDescriptor descriptor = super.buildXMLLoginConfigDescriptor(); XMLDirectMapping equalNamespaceResolversMapping = new XMLDirectMapping(); equalNamespaceResolversMapping.setAttributeName("m_equalNamespaceResolvers"); equalNamespaceResolversMapping.setGetMethodName("getEqualNamespaceResolvers"); equalNamespaceResolversMapping.setSetMethodName("setEqualNamespaceResolvers"); equalNamespaceResolversMapping.setXPath("equal-namespace-resolvers/text()"); equalNamespaceResolversMapping.setNullValue(Boolean.TRUE); descriptor.addMapping(equalNamespaceResolversMapping); XMLCompositeObjectMapping documentPreservationPolicyMapping = new XMLCompositeObjectMapping(); documentPreservationPolicyMapping.setReferenceClass(DocumentPreservationPolicyConfig.class); documentPreservationPolicyMapping.setAttributeName("m_documentPreservationPolicy"); documentPreservationPolicyMapping.setGetMethodName("getDocumentPreservationPolicy"); documentPreservationPolicyMapping.setSetMethodName("setDocumentPreservationPolicy"); documentPreservationPolicyMapping.setXPath("document-preservation-policy"); descriptor.addMapping(documentPreservationPolicyMapping); return descriptor; }
public static XMLDescriptor buildDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(MWEisOneToManyMapping.class); descriptor.getInheritancePolicy().setParentClass(MWEisReferenceMapping.class); // use an object type mapping so we can preserve object identity ObjectTypeConverter foreignKeyLocationConverter = new ObjectTypeConverter(); foreignKeyLocationConverter.addConversionValue(KEYS_ON_TARGET, KEYS_ON_TARGET); foreignKeyLocationConverter.addConversionValue(KEYS_ON_SOURCE, KEYS_ON_SOURCE); XMLDirectMapping foreignKeyLocationMapping = new XMLDirectMapping(); foreignKeyLocationMapping.setAttributeName("foreignKeyLocation"); foreignKeyLocationMapping.setXPath("foreign-key-location/text()"); foreignKeyLocationMapping.setNullValue(KEYS_ON_SOURCE); foreignKeyLocationMapping.setConverter(foreignKeyLocationConverter); descriptor.addMapping(foreignKeyLocationMapping); XMLCompositeObjectMapping groupingElementMapping = new XMLCompositeObjectMapping(); groupingElementMapping.setAttributeName("foreignKeyGroupingElement"); groupingElementMapping.setReferenceClass(MWXmlField.class); groupingElementMapping.setGetMethodName("getGroupingElementForTopLink"); groupingElementMapping.setSetMethodName("setGroupingElementForTopLink"); groupingElementMapping.setXPath("foreign-key-grouping-element"); descriptor.addMapping(groupingElementMapping); XMLCompositeObjectMapping containerPolicyMapping = new XMLCompositeObjectMapping(); containerPolicyMapping.setAttributeName("containerPolicy"); containerPolicyMapping.setReferenceClass(MWContainerPolicy.MWContainerPolicyRoot.class); containerPolicyMapping.setXPath("container-policy"); descriptor.addMapping(containerPolicyMapping); XMLCompositeObjectMapping deleteAllInteractionMapping = new XMLCompositeObjectMapping(); deleteAllInteractionMapping.setAttributeName("deleteAllInteraction"); deleteAllInteractionMapping.setReferenceClass(MWEisInteraction.class); deleteAllInteractionMapping.setXPath("delete-all-interaction"); descriptor.addMapping(deleteAllInteractionMapping); return descriptor; }
public ClassDescriptor buildOc4jJGroupsTransportManagerConfigDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(Oc4jJGroupsTransportManagerConfig.class); descriptor.getInheritancePolicy().setParentClass(TransportManagerConfig.class); XMLDirectMapping useSingleThreadedNotificationMapping = new XMLDirectMapping(); useSingleThreadedNotificationMapping.setAttributeName("m_useSingleThreadedNotification"); useSingleThreadedNotificationMapping.setGetMethodName("useSingleThreadedNotification"); useSingleThreadedNotificationMapping.setSetMethodName("setUseSingleThreadedNotification"); useSingleThreadedNotificationMapping.setXPath("use-single-threaded-notification/text()"); useSingleThreadedNotificationMapping.setNullValue( Boolean.valueOf(USE_SINGLE_THREADED_NOTIFICATION_DEFAULT)); descriptor.addMapping(useSingleThreadedNotificationMapping); XMLDirectMapping topicNameMapping = new XMLDirectMapping(); topicNameMapping.setAttributeName("m_topicName"); topicNameMapping.setGetMethodName("getTopicName"); topicNameMapping.setSetMethodName("setTopicName"); topicNameMapping.setXPath("topic-name/text()"); descriptor.addMapping(topicNameMapping); return descriptor; }