hibernate criteria query using disjunction and conjuction
===

I was wondering if anybody had any suggestions on how to combine these two queries into one. The biggest issue is determining if it's a dynamic user role or a static user role which is what differentiates the two queries. In the loops in the bottom of the code, I define the query type with a boolean value. 

The output would look something like this the following, dynamic being programs and static being operations. Thanks in advance. 

Draft Draft 	                Program 	9
Draft Draft 	                Operations 	27
Pending Assessor Review 	Program 	1
Pending Assessor Review 	Operations 	1
Pending Assignor Review 	Operations 	2
Pending Authorizer Review 	Operations 	2        

        Criterion creator = Restrictions.conjunction()
                .add(Restrictions.eq("creator", this.userInfo.getUser()))
                .add(Restrictions.eq("currentState.id", DatabaseConstants.STATE_DRAFT));
        
        Criterion authorizer = Restrictions.conjunction()
                .add(Restrictions.eq("authorizer", this.userInfo.getUser()))
                .add(Restrictions.eq("currentState.id", DatabaseConstants.STATE_AUTHORIZER_REVIEW));
        
        Criterion assessor = Restrictions.conjunction()
                .add(Restrictions.eq("assessor", this.userInfo.getUser()))
                .add(Restrictions.eq("currentState.id", DatabaseConstants.STATE_ASSESSOR_REVIEW));
                
        Criterion completeDynamicCondition = Restrictions.disjunction().add(creator)
                                                                .add(authorizer)
                                                                .add(assessor);
        
        Criteria criteriaDynamic = this.session.createCriteria(PurchaseRequest.class)
                .add(Restrictions.isNull("authorizedArchiveDate"))        
                .add(completeDynamicCondition);
        
        boolean hasStatic = false;
        
        Disjunction dis = Restrictions.disjunction(); 
                if(this.securityService.hasRole(RoleConstants.ROLE_AUTHORIZER)) {
                    dis.add(Restrictions.eq("currentState.id", DatabaseConstants.STATE_AUTHORIZER_REVIEW));
                    hasStatic = true;
                }
                
                if(this.securityService.hasRole(RoleConstants.ROLE_ASSIGNOR)) {
                    dis.add(Restrictions.eq("currentState.id", DatabaseConstants.STATE_ASSIGNOR_REVIEW));
                    hasStatic = true;
                }

        Criteria criteriaStatic = this.session.createCriteria(PurchaseRequest.class)
                .add(Restrictions.isNull("authorizedArchiveDate"));  

                if(!this.securityService.hasRole(RoleConstants.ROLE_OPERATION)) {   
                    if(hasStatic) {
                        criteriaStatic.add(dis);
                    } else {
                        criteriaStatic.setMaxResults(0);
                    }
                }

        ProjectionList projectionList = Projections.projectionList();
        projectionList.add(Projections.groupProperty("currentState"));
        projectionList.add(Projections.rowCount());

        criteriaDynamic.setProjection(projectionList);
        criteriaStatic.setProjection(projectionList);
                
        prCounts = new ArrayList<PurchaseRequestCount>();

        List<Object[]> resultsDynamic = criteriaDynamic.list();
        
        for (Object[] obj : resultsDynamic) {
            prCounts.add(new PurchaseRequestCount(obj, false));
        }
        
        List<Object[]> resultsStatic = criteriaStatic.list();
        
        for (Object[] obj : resultsStatic) {
            prCounts.add(new PurchaseRequestCount(obj, true));
        }