Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit cefdcce

Browse files
CaseFacade::isCaseEditAllowed returns primitive boolean now
1 parent 07e641f commit cefdcce

3 files changed

Lines changed: 11 additions & 12 deletions

File tree

sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseFacade.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Map<PresentCondition, Long> getCaseCountPerPersonCondition(
151151

152152
List<CaseReferenceDto> getRandomCaseReferences(CaseCriteria criteria, int count);
153153

154-
Boolean isCaseEditAllowed(String caseUuid);
154+
boolean isCaseEditAllowed(String caseUuid);
155155

156156
boolean exists(String uuid);
157157

sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseFacadeEjb.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ public List<CaseIndexDto> getIndexList(CaseCriteria caseCriteria, Integer first,
428428

429429
List<CaseIndexDto> cases;
430430
if (first != null && max != null) {
431-
TypedQuery query = em.createQuery(cq);
431+
TypedQuery<CaseIndexDto> query = em.createQuery(cq);
432432
cases = query.setFirstResult(first).setMaxResults(max).getResultList();
433433
} else {
434434
cases = em.createQuery(cq).getResultList();
@@ -2992,7 +2992,7 @@ public List<CaseFollowUpDto> getCaseFollowUpList(
29922992
CriteriaQuery<CaseFollowUpDto> cq = cb.createQuery(CaseFollowUpDto.class);
29932993
Root<Case> caze = cq.from(Case.class);
29942994

2995-
CaseJoins joins = new CaseJoins(caze);
2995+
CaseJoins<Case> joins = new CaseJoins<>(caze);
29962996

29972997
final Stream<Selection<?>> select = Stream.of(
29982998
caze.get(Case.UUID),
@@ -3089,15 +3089,15 @@ public List<CaseFollowUpDto> getCaseFollowUpList(
30893089
return resultList;
30903090
}
30913091

3092-
@LocalBean
3093-
@Stateless
3094-
public static class CaseFacadeEjbLocal extends CaseFacadeEjb {
3092+
public boolean isCaseEditAllowed(String caseUuid) {
3093+
Case caze = caseService.getByUuid(caseUuid);
30953094

3095+
return caseService.isCaseEditAllowed(caze);
30963096
}
30973097

3098-
public Boolean isCaseEditAllowed(String caseUuid) {
3099-
Case caze = caseService.getByUuid(caseUuid);
3098+
@LocalBean
3099+
@Stateless
3100+
public static class CaseFacadeEjbLocal extends CaseFacadeEjb {
31003101

3101-
return caseService.isCaseEditAllowed(caze);
31023102
}
31033103
}

sormas-ui/src/main/java/de/symeda/sormas/ui/caze/AbstractCaseView.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,12 @@ public ViewMode getViewMode() {
264264

265265
public void setCaseEditPermission(Component component) {
266266

267-
Boolean isCaseEditAllowed = isCaseEditAllowed();
268-
if (!isCaseEditAllowed) {
267+
if (!isCaseEditAllowed()) {
269268
component.setEnabled(false);
270269
}
271270
}
272271

273-
protected Boolean isCaseEditAllowed() {
272+
protected boolean isCaseEditAllowed() {
274273
return FacadeProvider.getCaseFacade().isCaseEditAllowed(getReference().getUuid());
275274
}
276275
}

0 commit comments

Comments
 (0)