code: private String getInboundRequestsWhere(Query query) {
          StringBuilder clause = new StringBuilder();
          clause.append("where d.owner_type = '" + OwnerType.LISTENER_REQUEST + "'\n");
  
          String find = query.getFind();
          Long id = query.getLongFilter("id");
          String path = query.getFilter("path");
          if (find != null) {
              try {
                  Long docId = Long.parseLong(find);
                  clause.append(" and d.document_id like '" + docId + "%'\n");
              }
              catch (NumberFormatException e) {
                  clause.append(" and d.path like '" + find + "%'\n");
              }
          }
          else if (id != null && id > 0) {
              clause.append(" and d.document_id = " + id + "\n");
          }
          else if (path != null) {
              clause.append(" and d.path like '" + path + "%'\n");
          }
          else if (query.getFilter("ownerId") != null) {
              clause.append(" and d.owner_id = " + query.getLongFilter("ownerId") + "\n");
          }
  
          return clause.toString();
      }
docs: TODO: honor status in query