code: public int getCount(SqlResource resource, Object param) {
          Node node = prepareNode(resource);
          SqlContext context = prepareSqlContext(param);
          node.accept(context);
          String sql = dialect.getCountSql(context.getSql());
  
          Integer result = sqlExecutor.getSingleResult(Integer.class, sql, context.getBindVariables());
          if(result == null){
              return 0;
          }
          return result.intValue();
      }
docs: {@inheritDoc}