1
0
-1

using formdatadao.load we can extract a specific row based on primary key but I want to extract all the data rows into a formrowset regardless of any condition or primary key and read from there later... Please do help..

    CommentAdd your comment...

    2 answers

    1.  
      2
      1
      0

      check here FormDataDao#find

       

          /**
           * 
           * @param condition
           * @param formDef
           * @param params
           * @param start
           * @param rowCount
           * 
           * @return FormRowSet
           * 
           * @throws Exception 
           */
          public FormRowSet findRecords(String condition, FormDefinition formDef, ArrayList params, Integer start, Integer rowCount) throws Exception {
              LogUtil.info(TAG, ">>>>>>> extra conditions : " + condition);
              LogUtil.info(TAG, ">>>>>>> Row Limits :  Start= " + start + ", Count= " + rowCount);
              FormRowSet rowSet = null;
              if (params.isEmpty() && (rowCount == null || rowCount == 0)) {
                  throw new Exception("if parameters are empty, `rows` must be specifed");
              }
              try {
                  FormDataDao formDataDao = (FormDataDao) AppUtil.getApplicationContext().getBean("formDataDao");
                  rowSet = formDataDao.find(formDef.getName(), formDef.getTableName(), condition, params.toArray(), null, null, start, rowCount);
              } catch (Exception ex) {
                  LogUtil.error(TAG, ex, ex.getMessage());
                  throw ex;
              }
              FormRowSet records = new FormRowSet();
              for (FormRow formRow : rowSet) {
                  String latestProcessId = null;
                  try {
                      latestProcessId = getLatestProcessId(formRow.getId());
                  } catch (Exception e) {
                      LogUtil.error(TAG, e, e.getMessage());
                  }
                  LogUtil.info(TAG, ">>>>>>> latestProcessId: " + latestProcessId);
                  formRow.put("latest_processId", latestProcessId);
                  records.add(formRow);
              }
              return records;
          }
        CommentAdd your comment...
      1.  
        1
        0
        -1

        You can use formdatadao.find and pass in no condition. It should return all and you can play with the rest of the parameters for paging purpose.

          CommentAdd your comment...