コード例 #1
0
ファイル: QueryManager.java プロジェクト: NCIP/rembrandt
  public static Integer getMaximumCountInCompoundQuery(Queriable queryToExecute) throws Exception {
    Integer count = null;
    if (queryToExecute instanceof CompoundQuery) {
      CompoundQuery compoundQuery = (CompoundQuery) queryToExecute;
      if (compoundQuery.getInstitutionCriteria() != null) {
        AddConstrainsToQueriesHelper helper = new AddConstrainsToQueriesHelper();
        compoundQuery =
            helper.constrainQueryWithInstitution(
                compoundQuery, compoundQuery.getInstitutionCriteria());
      }
      count = CompoundQueryProcessor.getMaxCount(compoundQuery);
    }

    return count;
  }
コード例 #2
0
ファイル: QueryManager.java プロジェクト: NCIP/rembrandt
  public static CompoundResultSet executeCompoundQuery(Queriable queryToExecute) throws Exception {
    CompoundResultSet compoundResultset = null;
    if (queryToExecute instanceof CompoundQuery) {
      CompoundQuery compoundQuery = (CompoundQuery) queryToExecute;
      if (compoundQuery.getInstitutionCriteria() != null) {
        AddConstrainsToQueriesHelper helper = new AddConstrainsToQueriesHelper();
        compoundQuery =
            helper.constrainQueryWithInstitution(
                compoundQuery, compoundQuery.getInstitutionCriteria());
      }
      // Get query count first
      // Integer count = getMaximumCountInCompoundQuery(compoundQuery);
      compoundResultset = CompoundQueryProcessor.execute(compoundQuery);
      if (compoundResultset != null & compoundResultset.getResults() != null) {
        Integer count = compoundResultset.getResults().size();
        if (count > RembrandtConstants.QUERY_LIMIT) {
          throw new Exception(RembrandtConstants.QUERY_OVER_LIMIT);
        }
      }
    }

    return compoundResultset;
  }