use of fr.univlorraine.ecandidat.entities.siscol.Commune in project esup-ecandidat by EsupPortail.
the class SiScolApogeeWSServiceImpl method getListSiScolCommune.
/**
* @see fr.univlorraine.ecandidat.services.siscol.SiScolGenericService#getListSiScolCommune()
*/
@Override
public List<SiScolCommune> getListSiScolCommune() throws SiScolException {
final List<SiScolCommune> liste = new ArrayList<>();
try {
executeQueryListEntity(Commune.class).forEach(commune -> {
final SiScolCommune siScolCommune = new SiScolCommune(commune.getCodCom(), commune.getLibCom(), MethodUtils.getBooleanFromTemoin(commune.getTemEnSveCom()));
if (commune.getDepartement() != null) {
siScolCommune.setSiScolDepartement(new SiScolDepartement(commune.getDepartement().getCodDep()));
}
liste.add(siScolCommune);
});
} catch (final Exception e) {
throw new SiScolException("SiScol database error on getListSiScolCommune", e.getCause());
}
return liste;
}
Aggregations