org.modeshape.jcr.query
Class JcrQueryResult

java.lang.Object
  extended by org.modeshape.jcr.query.JcrQueryResult
All Implemented Interfaces:
QueryResult
Direct Known Subclasses:
JcrSqlQueryResult, XPathQueryResult

@NotThreadSafe
public class JcrQueryResult
extends Object
implements QueryResult, QueryResult

The results of a query. This is not thread-safe because it relies upon JcrSession, which is not thread-safe. Also, although the results of a query never change, the objects returned by the iterators may vary if the session information changes.

See Also:
XPathQueryResult, JcrSqlQueryResult

Nested Class Summary
protected static class JcrQueryResult.MultiSelectorQueryResultRow
           
protected static class JcrQueryResult.QueryResultNodeIterator
          The NodeIterator implementation returned by the JcrQueryResult.
protected static class JcrQueryResult.QueryResultRowIterator
          The RowIterator implementation returned by the JcrQueryResult.
protected static class JcrQueryResult.SingleSelectorQueryResultRow
           
protected static class JcrQueryResult.SingleSelectorQueryResultRowIterator
          The RowIterator implementation returned by the JcrQueryResult.
 
Field Summary
protected  JcrQueryContext context
           
protected  String queryStatement
           
protected  QueryResults results
           
protected  Schemata schemata
           
 
Constructor Summary
protected JcrQueryResult(JcrQueryContext context, String query, QueryResults graphResults, Schemata schemata)
           
 
Method Summary
 List<String> getColumnNameList()
           
 String[] getColumnNames()
          
 List<String> getColumnTypeList()
           
 String[] getColumnTypes()
          Returns an array of the PropertyType name for each of the columns in this result.
 NodeIterator getNodes()
          
 String getPlan()
          Get a description of the query plan, if requested.
 RowIterator getRows()
          
 String[] getSelectorNames()
          Returns an array of the name of the selector (i.e., table) from which each column originates.
protected  QueryResults results()
           
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

context

protected final JcrQueryContext context

results

protected final QueryResults results

schemata

protected final Schemata schemata

queryStatement

protected final String queryStatement
Constructor Detail

JcrQueryResult

protected JcrQueryResult(JcrQueryContext context,
                         String query,
                         QueryResults graphResults,
                         Schemata schemata)
Method Detail

results

protected QueryResults results()

getColumnNameList

public List<String> getColumnNameList()

getColumnTypeList

public List<String> getColumnTypeList()

getColumnNames

public String[] getColumnNames()

Specified by:
getColumnNames in interface QueryResult
See Also:
QueryResult.getColumnNames()

getColumnTypes

public String[] getColumnTypes()
Returns an array of the PropertyType name for each of the columns in this result.

Returns:
the array of property type names; never null, never has null elements, and the size always matches QueryResult.getColumnNames().
See Also:
QueryResult.getColumnTypes()

getSelectorNames

public String[] getSelectorNames()
Returns an array of the name of the selector (i.e., table) from which each column originates. Note that the table name will be "" for all fabricated columns.

Specified by:
getSelectorNames in interface QueryResult
Returns:
the array of table names; never null, and the size always matches QueryResult.getColumnNames()
See Also:
QueryResult.getSelectorNames()

getNodes

public NodeIterator getNodes()
                      throws RepositoryException

Specified by:
getNodes in interface QueryResult
Throws:
RepositoryException
See Also:
QueryResult.getNodes()

getRows

public RowIterator getRows()

Specified by:
getRows in interface QueryResult
See Also:
QueryResult.getRows()

getPlan

public String getPlan()
Get a description of the query plan, if requested.

Returns:
the query plan, or null if the plan was not requested

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.