code: public Long getCount() {
          if (count == 0L || !suppressCounts) {
              if (metaModel.cached()) {
                  count = (Long) QueryCache.instance().getItem(metaModel.getTableName(), countQueryFull, params);
                  if (count == null || count == 0) {
                      count = doCount();
                      QueryCache.instance().addItem(metaModel.getTableName(), countQueryFull, params, count);
                  }else {
                      LogFilter.logQuery(LOGGER, countQueryFull, params, System.currentTimeMillis(), true);
                  }
              } else {
                  count = doCount();
              }
              return count;
  
          } else {
              return count;
          }
      }
docs: Returns total count of records based on provided criteria.
  
  @return total count of records based on provided criteria