return false;
}
private void completeLocation(EntityJPA entity) {
if (entity instanceof AdminDivision) {
Country ct = (Country) countryDAO.findByCtCode(((AdminDivision) entity).getCountry().getCode());
if (ct == null) {
LOGGER.error("Country by ct code {} not found", ((AdminDivision) entity).getCountry().getCode());
} else {
((AdminDivision) entity).setCountry(ct);
}
} else if (entity instanceof City) {
AdminDivision adm = null;
City city = (City) entity;
if (city.getAdmDivision() != null && city.getAdmDivision().getCode() != null) {
adm = (AdminDivision) regionAdmDAO.findByAdmCode(((City) entity).getAdmDivision().getCode());
}
((City) entity).setAdmDivision(adm);
Country ct = (Country) countryDAO.findByCtCode(((City) entity).getCountry().getCode());
if (ct == null) {
LOGGER.error("Country by ct code {} not found", ((City) entity).getCountry().getCode());
} else {
((City) entity).setCountry(ct);
}