break;
}
case ADD_COLUMN_TEMPLATE: {
final String value = getElementText(reader);
if (!isEmpty(value)) {
metaData.setAddColumnTemplate(new JDBCFunctionMappingMetaData("add-column-template", value));
} else {
metaData.setAddColumnTemplate(new JDBCFunctionMappingMetaData("add-column-template", "ALTER TABLE ?1 ADD ?2 ?3"));
}
break;
}
case ALIAS_HEADER_PREFIX: {
final String value = getElementText(reader);
if (!isEmpty(value)) {
metaData.setAliasHeaderPrefix(value);
}
break;
}
case ALIAS_HEADER_SUFFIX: {
final String value = getElementText(reader);
if (!isEmpty(value)) {
metaData.setAliasHeaderSuffix(value);
}
break;
}
case ALIAS_MAX_LENGHT: {
final String value = getElementText(reader);
try {
final int aliasMaxLength = Integer.parseInt(value);
metaData.setAliasMaxLength(aliasMaxLength);
} catch (NumberFormatException e) {
throw MESSAGES.invalidNumberFormat("alias-max-length", value);
}
break;
}
case ALTER_COLUMN_TEMPLATE: {
final String value = getElementText(reader);
if (!isEmpty(value)) {
metaData.setAlterColumnTemplate(new JDBCFunctionMappingMetaData("add-column-template", value));
} else {
metaData.setAlterColumnTemplate(new JDBCFunctionMappingMetaData("add-column-template", "ALTER TABLE ?1 ADD ?2 ?3"));
}
break;
}
case AUTO_INCREMENT_TEMPLATE: {
final String value = getElementText(reader);
if (!isEmpty(value)) {
metaData.setAutoIncrementTemplate(new JDBCFunctionMappingMetaData("auto-increment", value));
}
break;
}
case DROP_COLUMN_TEMPLATE: {
final String value = getElementText(reader);
if (!isEmpty(value)) {
metaData.setDropColumnTemplate(new JDBCFunctionMappingMetaData("drop-column-template", value));
} else {
metaData.setDropColumnTemplate(new JDBCFunctionMappingMetaData("drop-column-template", "ALTER TABLE ?1 DROP ?2"));
}
break;
}
case FALSE_MAPPING: {
final String value = getElementText(reader);
if (!isEmpty(value)) {
metaData.setFalseMapping(value);
}
break;
}
case FK_CONSTRAINT_TEMPLATE: {
final String value = getElementText(reader);
if (!isEmpty(value)) {
metaData.setFKConstraintTemplate(new JDBCFunctionMappingMetaData("fk-constraint", value));
}
break;
}
case FUNCTION_MAPPING: {
metaData.addFunctionMapping(parseFunctionMapping(reader));
break;
}
case MAPPING: {
metaData.addMapping(parseMapping(reader));
break;
}
case MAX_KEYS_IN_DELETE: {
final String value = getElementText(reader);
try {
final int maxKeys = Integer.parseInt(value);
metaData.setMaxKeysInDelete(maxKeys);
} catch (NumberFormatException e) {
throw MESSAGES.invalidNumberFormat("max-keys-in-delete", value);
}
break;
}
case PK_CONSTRAINT_TEMPLATE: {
final String value = getElementText(reader);
if (!isEmpty(value)) {
metaData.setPKConstraintTemplate(new JDBCFunctionMappingMetaData("pk-constraint", value));
}
break;
}
case ROW_LOCKING_TEMPLATE: {
final String value = getElementText(reader);
if (!isEmpty(value)) {
metaData.setRowLockingTemplate(new JDBCFunctionMappingMetaData("row-locking", value));
}
break;
}
case SUBQUERY_SUPPORTED: {
metaData.setSubQuerySupported(Boolean.valueOf(getElementText(reader)));