List<Language> languages = serviceContext.getBean(LanguageRepository.class).findAll();
List<CswCapabilitiesInfoField> toSave = new ArrayList<CswCapabilitiesInfoField>();
final CswCapabilitiesInfoFieldRepository capabilitiesInfoFieldRepository = serviceContext.getBean(CswCapabilitiesInfoFieldRepository.class);
for (Language language : languages) {
CswCapabilitiesInfo cswCapInfo = capabilitiesInfoFieldRepository.findCswCapabilitiesInfo(language.getId());
final String langId = language.getId();
cswCapInfo.setTitle(getValue(params, "csw.title_" + langId));
cswCapInfo.setAbstract(getValue(params, "csw.abstract_" + langId));
cswCapInfo.setFees(getValue(params, "csw.fees_" + langId));
cswCapInfo.setAccessConstraints(getValue(params, "csw.accessConstraints_" + langId));
toSave.addAll(cswCapInfo.getFields());
}
capabilitiesInfoFieldRepository.save(toSave);
}