use of org.n52.series.db.beans.i18n.I18nUnitEntity in project SOS by 52North.
the class HibernatePredefinedInsertionHandler method convert.
private UnitEntity convert(Unit unit) {
UnitEntity entity = new UnitEntity();
entity.setSymbol(unit.getSymbol(), getDaoFactory().isStaSupportsUrls());
entity.setName(unit.getName());
entity.setLink(unit.getLink());
if (unit.hasTranslations()) {
Set<I18nEntity<? extends Describable>> trans = new LinkedHashSet<>();
unit.getTranslations().forEach(i -> {
I18nUnitEntity i18n = new I18nUnitEntity();
i18n.setLocale(i.getLocale());
i18n.setName(i.getName());
i18n.setDescription(i.getDescription());
trans.add(i18n);
});
entity.setTranslations(trans);
}
return entity;
}
Aggregations