}
private void convertMappings() throws Exception {
String newSourceSchema = null;
String newTargetSchema = null;
Case toCase = null;
if (inputTransform != null) {
newSourceSchema = inputTransform.getNewSchemaName();
toCase = inputTransform.getNewCase();
}
if (outputTransform != null) {
newTargetSchema = outputTransform.getNewSchemaName();
assert toCase == null || toCase == outputTransform.getNewCase();
toCase = outputTransform.getNewCase();
}
if (toCase == null) {
throw new RuntimeException("One of inputTransform or outputTransform must be set");
}
for (Element mapping : Elements.matching("Entity/Mappings/Mapping", dom)) {
Element script = KongaXmlUtils.getFirstElementChildOfName(mapping, "konga.string");
if (script != null) {
String mapString = KongaXmlUtils.getElementValue(script);
String convertedMapString = Transform.switchCaseOwnerForDbDataElement(
mapString, toCase, toCase.convert(newSourceSchema), toCase.convert(newTargetSchema));
script.setTextContent(convertedMapString);
}
}
}