if (logger.isInfoEnabled()) logger.info("AddressType table is empty. Generating data...");
Properties allTypes = addressTypes.entrySet().iterator().next().getValue();
for (String code : allTypes.stringPropertyNames()) {
if (logger.isDebugEnabled()) logger.debug("Creating address type [" + code + "]");
try {
AddressType type = new AddressType();
type.setType(new I18nText());
for (Locale locale : addressTypes.keySet())
type.getType().add(locale, addressTypes.get(locale).getProperty(code));
dao.create(type);
} catch (Exception ex) {
if (logger.isDebugEnabled()) logger.debug("Address type [" + code + "] could not be saved: " + ex.getMessage());
}
}