XMLDirectMapping validateConnectionHealthOnErrorMapping = new XMLDirectMapping();
validateConnectionHealthOnErrorMapping.setAttributeName("connectionHealthValidatedOnError");
validateConnectionHealthOnErrorMapping.setGetMethodName("isConnectionHealthValidatedOnError");
validateConnectionHealthOnErrorMapping.setSetMethodName("setConnectionHealthValidatedOnError");
validateConnectionHealthOnErrorMapping.setXPath("toplink: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("toplink: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("toplink: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("toplink:ping-sql/text()");
pingSQLMapping.setNullPolicy(new NullPolicy(null, false, false, false));
descriptor.addMapping(pingSQLMapping);
return descriptor;
}