For best performance, should I prefer NodeIterator or RowIterator, given that I'm retrieving the set of all schema-defined properties on a node type? Should the performance be exactly the same with the following two implementations?

Node Iterator implementation:
    NodeIterator nodes = result.getNodes();
    for(int i = 0; i < resultCount; i++)
    {
      StringBuffer rowStr = new StringBuffer();
      Node next = (Node)nodes.nextNode();
      PropertyIterator props = next.getProperties();
      while(props.hasNext())
rowStr.append(props.nextProperty().getValue().getString() + " |");
    }

Row iterator implementation:
    RowIterator rows = result.getRows();
    for(int i = 0; i < resultCount; i++)
    {
      StringBuffer rowStr = new StringBuffer();
      Row next = (Row)rows.nextRow();
      Value[] props = next.getValues();
      for(Value val : props)
      {
        rowStr.append(val.getString() + " |");
      }
    }

Reply via email to