use of de.symeda.sormas.api.infrastructure.subcontinent.SubcontinentCriteria in project SORMAS-Project by hzi-braunschweig.
the class LocationEditForm method setContinentFieldsVisibility.
public void setContinentFieldsVisibility() {
if (FacadeProvider.getContinentFacade().count(new ContinentCriteria().relevanceStatus(EntityRelevanceStatus.ACTIVE)) == 0) {
continent.setVisible(false);
continent.clear();
} else {
continent.setVisible(true);
}
if (FacadeProvider.getSubcontinentFacade().count(new SubcontinentCriteria().relevanceStatus(EntityRelevanceStatus.ACTIVE)) == 0) {
subcontinent.setVisible(false);
subcontinent.clear();
} else {
subcontinent.setVisible(true);
}
}
use of de.symeda.sormas.api.infrastructure.subcontinent.SubcontinentCriteria in project SORMAS-Project by hzi-braunschweig.
the class ContinentFacadeEjbTest method testSubcontinent.
@Test
public void testSubcontinent() {
final Continent continent = creator.createContinent("EUROPE");
final SubcontinentDto subcontinentDto = new SubcontinentDto();
subcontinentDto.setDefaultName("CENTRAL_EUROPE");
subcontinentDto.setContinent(continent.toReference());
getSubcontinentFacade().save(subcontinentDto);
final List<SubcontinentReferenceDto> subcontinents = getSubcontinentFacade().getByDefaultName("CENTRAL_EUROPE", false);
assertEquals(1, subcontinents.size());
final SubcontinentDto savedSubcontinentDto = getSubcontinentFacade().getByUuid(subcontinents.get(0).getUuid());
assertEquals("CENTRAL_EUROPE", savedSubcontinentDto.getDefaultName());
assertEquals(I18nProperties.getContinentName("EUROPE"), savedSubcontinentDto.getContinent().getCaption());
final List<SubcontinentIndexDto> indexList = getSubcontinentFacade().getIndexList(new SubcontinentCriteria().continent(continent.toReference()), null, null, null);
assertEquals(1, indexList.size());
final SubcontinentIndexDto subcontinentIndexDto = indexList.get(0);
assertEquals("CENTRAL_EUROPE", subcontinentIndexDto.getDefaultName());
assertEquals(I18nProperties.getContinentName("EUROPE"), subcontinentIndexDto.getContinent().getCaption());
assertEquals("Central Europe", subcontinentIndexDto.getDisplayName());
}
Aggregations