final String regionValue = rs.getString("REGION_VALUE");
final String exchangeScheme = rs.getString("EXCHANGE_SCHEME");
final String exchangeValue = rs.getString("EXCHANGE_VALUE");
final String currencyISO = rs.getString("CURRENCY_ISO");
UniqueId uniqueId = createUniqueId(docOid, docId);
ManageableHoliday holiday = new ManageableHoliday();
holiday.setUniqueId(uniqueId);
holiday.setType(HolidayType.valueOf(type));
if (regionScheme != null && regionValue != null) {
holiday.setRegionExternalId(ExternalId.of(regionScheme, regionValue));
}
if (exchangeScheme != null && exchangeValue != null) {
holiday.setExchangeExternalId(ExternalId.of(exchangeScheme, exchangeValue));
}
if (currencyISO != null) {
holiday.setCurrency(Currency.of(currencyISO));
}
HolidayDocument doc = new HolidayDocument(holiday);
doc.setVersionFromInstant(DbDateUtils.fromSqlTimestamp(versionFrom));
doc.setVersionToInstant(DbDateUtils.fromSqlTimestampNullFarFuture(versionTo));
doc.setCorrectionFromInstant(DbDateUtils.fromSqlTimestamp(correctionFrom));