org.modeshape.jcr.query.qom
Class JcrSetQuery

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

public class JcrSetQuery
extends SetQuery
implements SetQuery, JcrQueryCommand

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.modeshape.graph.query.model.SetQuery
SetQuery.Operation
 
Constructor Summary
JcrSetQuery(JcrQueryCommand left, SetQuery.Operation operation, JcrQueryCommand right, boolean all)
          Create a set query involving the supplied left- and right-hand-side queries.
JcrSetQuery(JcrQueryCommand left, SetQuery.Operation operation, JcrQueryCommand right, boolean all, List<? extends JcrOrdering> orderings, JcrLimit limit)
          Create a set query involving the supplied left- and right-hand-side queries.
 
Method Summary
 List<? extends JcrColumn> columns()
          Return the columns defining the query results.
 Column[] getColumns()
          Gets the columns for this query.
 JcrQueryCommand getLeft()
          Get the left-hand query.
 Limit getLimits()
          Get the limits associated with this query.
 String getOperation()
          Get the set operation for this query.
 Ordering[] getOrderings()
          Gets the orderings for this query.
 JcrQueryCommand getRight()
          Get the right-hand query.
 JcrQueryCommand left()
          Get the left-hand query.
 JcrLimit limits()
          Get the limits associated with this query.
 List<? extends JcrOrdering> orderings()
          Return the orderings for this query.
 JcrQueryCommand right()
          Get the right-hand query.
 JcrSetQuery withLimit(int rowLimit)
          Create a copy of this query, but one that uses the supplied limit on the number of result rows.
 JcrSetQuery 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.SetQuery
accept, adding, equals, hashCode, isAll, operation, toString, unionableColumns
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.modeshape.jcr.api.query.qom.SetQuery
isAll
 
Methods inherited from interface org.modeshape.graph.query.model.Visitable
accept
 

Constructor Detail

JcrSetQuery

public JcrSetQuery(JcrQueryCommand left,
                   SetQuery.Operation operation,
                   JcrQueryCommand right,
                   boolean all)
Create a set query involving the supplied left- and right-hand-side queries.

Parameters:
left - the left-hand-side query being combined
operation - the set operation
right - the right-hand-side query being combined
all - true if all of the results should be included
Throws:
IllegalArgumentException - if the left-hand-side query, right-hand-side query, or operation are null

JcrSetQuery

public JcrSetQuery(JcrQueryCommand left,
                   SetQuery.Operation operation,
                   JcrQueryCommand right,
                   boolean all,
                   List<? extends JcrOrdering> orderings,
                   JcrLimit limit)
Create a set query involving the supplied left- and right-hand-side queries.

Parameters:
left - the left-hand-side query being combined
operation - the set operation
right - the right-hand-side query being combined
all - true if all of the results should be included
orderings - the specification of the order of the result rows, or null if the results need not be ordered
limit - the limit for the result rows, or null if there are no limits
Throws:
IllegalArgumentException - if the left-hand-side query, right-hand-side query, or operation are null
Method Detail

left

public JcrQueryCommand left()
Get the left-hand query.

Overrides:
left in class SetQuery
Returns:
the left-hand query; never null
See Also:
SetQuery.left()

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 SetQuery
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 SetQuery
Returns:
the list of orderings; never null
See Also:
Query.orderings()

right

public JcrQueryCommand right()
Get the right-hand query.

Overrides:
right in class SetQuery
Returns:
the right-hand query; never null
See Also:
SetQuery.right()

limits

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

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

getLimits

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

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

getLeft

public JcrQueryCommand getLeft()
Get the left-hand query.

Specified by:
getLeft in interface SetQuery
Returns:
the left-hand query; never null
See Also:
SetQuery.getLeft()

getRight

public JcrQueryCommand getRight()
Get the right-hand query.

Specified by:
getRight in interface SetQuery
Returns:
the right-hand query; never null
See Also:
SetQuery.getRight()

getOperation

public String getOperation()
Get the set operation for this query.

Specified by:
getOperation in interface SetQuery
Returns:
the operation; never null
See Also:
SetQuery.getOperation()

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 JcrSetQuery 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 SetQuery
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:
SetQuery.withLimit(int)

withOffset

public JcrSetQuery 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 SetQuery
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:
SetQuery.withOffset(int)


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