use of org.n52.series.db.beans.i18n.I18nPhenomenonEntity in project SOS by 52North.
the class HibernatePredefinedInsertionHandler method convert.
private PhenomenonEntity convert(Phenomenon phenomenon) {
PhenomenonEntity entity = new PhenomenonEntity();
entity.setIdentifier(phenomenon.getIdentifier(), daoFactory.isStaSupportsUrls());
entity.setName(phenomenon.getName());
entity.setDescription(phenomenon.getDescription());
if (phenomenon.hasTranslations()) {
Set<I18nEntity<? extends Describable>> trans = new LinkedHashSet<>();
phenomenon.getTranslations().forEach(i -> {
I18nPhenomenonEntity i18n = new I18nPhenomenonEntity();
i18n.setLocale(i.getLocale());
i18n.setName(i.getName());
i18n.setDescription(i.getDescription());
trans.add(i18n);
});
entity.setTranslations(trans);
}
return entity;
}
Aggregations