diff --git a/src/main/java/info/bukova/isspst/services/users/RoleServiceImpl.java b/src/main/java/info/bukova/isspst/services/users/RoleServiceImpl.java index 01fcae2c..070d6449 100644 --- a/src/main/java/info/bukova/isspst/services/users/RoleServiceImpl.java +++ b/src/main/java/info/bukova/isspst/services/users/RoleServiceImpl.java @@ -87,7 +87,7 @@ public class RoleServiceImpl extends AbstractService implements RoleServic @Override @Transactional public boolean isInWorkflow(Role role) { - Query q = dao.getQuery("select count(*) from Workflow where role = :role"); + Query q = dao.getQuery("select count(rt) from RequirementType rt join rt.workflow w join w.role role where role = :role"); q.setParameter("role", role); long i = (Long)q.uniqueResult(); return i != 0;