org.modeshape.jcr.query.qom
Class JcrSelectQuery

java.lang.Object
  extended by org.modeshape.graph.query.model.Query
      extended by org.modeshape.jcr.query.qom.JcrSelectQuery
All Implemented Interfaces:
Serializable, Command, LanguageObject, QueryCommand, Visitable, SelectQuery, JcrQueryCommand

public class JcrSelectQuery
extends Query
implements SelectQuery, JcrQueryCommand

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.modeshape.graph.query.model.Query
IS_DISTINCT_DEFAULT
 
Constructor Summary
JcrSelectQuery(JcrSource source, JcrConstraint constraint, List<? extends JcrOrdering> orderings, List<? extends JcrColumn> columns, JcrLimit limit, boolean isDistinct)
          Create a new query that uses the supplied source, constraint, orderings, columns and limits.
 
Method Summary
 List<? extends JcrColumn> columns()
          Return the columns defining the query results.
 JcrConstraint constraint()
          Get the constraints, if there are any.
 Column[] getColumns()
          Gets the columns for this query.
 Constraint getConstraint()
          Gets the constraint for this query.
 Limit getLimits()
          Get the limits associated with this query.
 Ordering[] getOrderings()
          Gets the orderings for this query.
 Source getSource()
          Gets the node-tuple source for this query.
 JcrLimit limits()
          Get the limits associated with this query.
 List<? extends JcrOrdering> orderings()
          Return the orderings for this query.
 JcrSource source()
          Get the source for the results.
 Query withLimit(int rowLimit)
          Create a copy of this query, but one that uses the supplied limit on the number of result rows.
 Query withOffset(int offset)
          Create a copy of this query, but one that uses the supplied offset.
 
Methods inherited from class org.modeshape.graph.query.model.Query
accept, adding, adding, constrainedBy, distinct, equals, hashCode, isDistinct, noDistinct, orderedBy, returning, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.modeshape.graph.query.model.Visitable
accept
 

Constructor Detail

JcrSelectQuery

public JcrSelectQuery(JcrSource source,
                      JcrConstraint constraint,
                      List<? extends JcrOrdering> orderings,
                      List<? extends JcrColumn> columns,
                      JcrLimit limit,
                      boolean isDistinct)
Create a new query that uses the supplied source, constraint, orderings, columns and limits.

Parameters:
source - the source
constraint - the constraint (or composite constraint), or null or empty if there are no constraints
orderings - the specifications of how the results are to be ordered, or null if the order is to be implementation determined
columns - the columns to be included in the results, or null or empty if there are no explicit columns and the actual result columns are to be implementation determiend
limit - the limit for the results, or null if all of the results are to be included
isDistinct - true if duplicates are to be removed from the results
Throws:
IllegalArgumentException - if the source is null
Method Detail

limits

public JcrLimit limits()
Get the limits associated with this query.

Specified by:
limits in interface QueryCommand
Overrides:
limits in class Query
Returns:
the limits; never null but possibly unlimited
See Also:
Query.limits()

constraint

public JcrConstraint constraint()
Get the constraints, if there are any.

Overrides:
constraint in class Query
Returns:
the constraint; may be null
See Also:
Query.constraint()

source

public JcrSource source()
Get the source for the results.

Overrides:
source in class Query
Returns:
the query source; never null
See Also:
Query.source()

columns

public List<? extends JcrColumn> columns()
Return the columns defining the query results. If there are no columns, then the columns are implementation determined.

Specified by:
columns in interface QueryCommand
Overrides:
columns in class Query
Returns:
the list of columns; never null
See Also:
Query.columns()

orderings

public List<? extends JcrOrdering> orderings()
Return the orderings for this query.

Specified by:
orderings in interface QueryCommand
Overrides:
orderings in class Query
Returns:
the list of orderings; never null
See Also:
Query.orderings()

getConstraint

public Constraint getConstraint()
Gets the constraint for this query.

Specified by:
getConstraint in interface SelectQuery
Returns:
the constraint, or null if none
See Also:
SelectQuery.getConstraint()

getSource

public Source getSource()
Gets the node-tuple source for this query.

Specified by:
getSource in interface SelectQuery
Returns:
the node-tuple source; non-null
See Also:
SelectQuery.getSource()

getLimits

public Limit getLimits()
Get the limits associated with this query.

Returns:
the limits; never null but possibly unlimited
See Also:
QueryCommand.getLimits()

getColumns

public Column[] getColumns()
Gets the columns for this query.

Returns:
an array of zero or more columns; non-null
See Also:
QueryCommand.getColumns()

getOrderings

public Ordering[] getOrderings()
Gets the orderings for this query.

Returns:
an array of zero or more orderings; non-null
See Also:
QueryCommand.getOrderings()

withLimit

public Query withLimit(int rowLimit)
Create a copy of this query, but one that uses the supplied limit on the number of result rows.

Specified by:
withLimit in interface QueryCommand
Overrides:
withLimit in class Query
Parameters:
rowLimit - the limit that should be used; must be a positive number
Returns:
the copy of the query that uses the supplied limit; never null
See Also:
Query.withLimit(int)

withOffset

public Query withOffset(int offset)
Create a copy of this query, but one that uses the supplied offset.

Specified by:
withOffset in interface QueryCommand
Overrides:
withOffset in class Query
Parameters:
offset - the limit that should be used; may not be negative
Returns:
the copy of the query that uses the supplied offset; never null
See Also:
Query.withOffset(int)


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