|
|
@@ -2,6 +2,7 @@ package com.x.portal.assemble.designer.jaxrs.portal;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import javax.persistence.EntityManager;
|
|
|
import javax.persistence.criteria.CriteriaBuilder;
|
|
|
@@ -60,8 +61,8 @@ abstract class BaseAction extends StandardJaxrsAction {
|
|
|
p = cb.isMember(effectivePerson.getDistinguishedName(), root.get(Portal_.controllerList));
|
|
|
p = cb.or(p, cb.equal(root.get(Portal_.creatorPerson), effectivePerson.getDistinguishedName()));
|
|
|
}
|
|
|
- cq.select(root.get(Portal_.id)).where(p).distinct(true);
|
|
|
- List<String> list = em.createQuery(cq.select(root.get(Portal_.id)).where(p)).getResultList();
|
|
|
+ cq.select(root.get(Portal_.id)).where(p);
|
|
|
+ List<String> list = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
@@ -77,8 +78,8 @@ abstract class BaseAction extends StandardJaxrsAction {
|
|
|
p = cb.or(p, cb.equal(root.get(Portal_.creatorPerson), effectivePerson.getDistinguishedName()));
|
|
|
}
|
|
|
p = cb.and(p, cb.equal(root.get(Portal_.portalCategory), Objects.toString(portalCategory, "")));
|
|
|
- cq.select(root.get(Portal_.id)).where(p).distinct(true);
|
|
|
- List<String> list = em.createQuery(cq.select(root.get(Portal_.id)).where(p)).getResultList();
|
|
|
+ cq.select(root.get(Portal_.id)).where(p);
|
|
|
+ List<String> list = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());
|
|
|
return list;
|
|
|
}
|
|
|
|