String urlName = cdoUnitType.getUrl();
URL url;
try {
url = new URL(urlName);
} catch (MalformedURLException e) {
throw new CdoException("Cannot convert '" + urlName + "' to url.");
}
String providerName = cdoUnitType.getProvider();
Class<? extends CdoDatastoreProvider> provider = ClassHelper.getType(providerName);
Set<Class<?>> types = new HashSet<>();
for (String typeName : cdoUnitType.getTypes().getType()) {
types.add(ClassHelper.getType(typeName));
}
ValidationModeType validationModeType = cdoUnitType.getValidationMode();
ValidationMode validationMode;
if (validationModeType != null) {
switch (validationModeType) {
case NONE:
validationMode = ValidationMode.NONE;
break;
case AUTO:
validationMode = ValidationMode.AUTO;
break;
default:
throw new CdoException("Unknown validation mode type " + validationModeType);
}
} else {
validationMode = ValidationMode.AUTO;
}
TransactionAttributeType defaultTransactionAttributeType = cdoUnitType.getDefaultTransactionAttribute();
TransactionAttribute defaultTransactionAttribute;
if (defaultTransactionAttributeType != null) {
switch (defaultTransactionAttributeType) {
case MANDATORY:
defaultTransactionAttribute = TransactionAttribute.MANDATORY;
break;
case REQUIRES:
defaultTransactionAttribute = TransactionAttribute.REQUIRES;
break;
default:
throw new CdoException("Unknown transaction attribute type " + defaultTransactionAttributeType);
}
} else {
defaultTransactionAttribute = TransactionAttribute.MANDATORY;
}
Properties properties = new Properties();