break;
}
case ADD_COLUMN_TEMPLATE: {
final String value = getElementText(reader);
if (!isEmpty(value)) {
metaData.setAddColomnTemplate(new JDBCFunctionMappingMetaData("add-column-template", value));
} else {
metaData.setAddColomnTemplate(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 new IllegalArgumentException("Invalid number format in alias-max-length " + value + "': " + e);
}
break;
}
case ALTER_COLUMN_TEMPLATE: {
final String value = getElementText(reader);
if (!isEmpty(value)) {
metaData.setAlterColomnTemplate(new JDBCFunctionMappingMetaData("add-column-template", value));
} else {
metaData.setAlterColomnTemplate(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.setDropColomnTemplate(new JDBCFunctionMappingMetaData("drop-column-template", value));
} else {
metaData.setDropColomnTemplate(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(parseFuctionMapping(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 new IllegalArgumentException("Invalid number format in max-keys-in-delete " + value + "': " + e);
}
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)));