org.modeshape.jcr.query.engine.process

## Class DependentQuery

- java.lang.Object
- - org.modeshape.jcr.query.NodeSequence
  - - org.modeshape.jcr.query.engine.process.DependentQuery

-     public class DependentQuery
      extends NodeSequence

  A node sequence implementation that performs an independent query to find results that are required for a dependent query. At this time, all of the results of the first query are kept in-memory, and stored in a variable where it is then accessed by the dependent query.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.modeshape.jcr.query.NodeSequence

      `NodeSequence.AlternateSizeBatch, NodeSequence.Batch, NodeSequence.LimitBatch, NodeSequence.MultiWidthBatch, NodeSequence.Restartable, NodeSequence.RowAccessor, NodeSequence.RowFilter, NodeSequence.SingleWidthBatch`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static Logger` | `logger`

    - ### Fields inherited from class org.modeshape.jcr.query.NodeSequence

      `LOGGER, NO_PASS_ROW_FILTER, PASS_ROW_FILTER`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DependentQuery(NodeSequence independentQuery, RowExtractors.ExtractFromRow independentQueryValueExtractor, TypeSystem.TypeFactory<?> expectedType, NodeSequence dependentQuery, String variableName, Map<String,Object> variables)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Signal that this node sequence is no longer needed.
    `long` | `getRowCount()` Get the number of rows in this sequence.
    `protected void` | `initialize()`
    `boolean` | `isEmpty()` Determine whether this results is known to be empty.
    `NodeSequence.Batch` | `nextBatch()` Get the next batch of `NodeKey` instances.
    `int` | `width()` Get the number of nodes in each row.

    - ### Methods inherited from class org.modeshape.jcr.query.NodeSequence

      `append, batchFilteredWith, batchOf, batchOf, batchOf, batchOfKeys, batchOfKeys, batchOfKeys, batchOfKeys, batchWithCount, copy, emptyBatch, emptySequence, filter, keyFor, limit, limit, merging, requireBoth, requireEither, skip, withBatch, withBatches, withBatches, withNode, withNodeKeys, withNodeKeys, withNodeKeys, withNodeKeys, withNodes, withNodes`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### logger

          protected static final Logger logger

  - ### Constructor Detail

    - #### DependentQuery

          public DependentQuery(NodeSequence independentQuery,
                        RowExtractors.ExtractFromRow independentQueryValueExtractor,
                        TypeSystem.TypeFactory<?> expectedType,
                        NodeSequence dependentQuery,
                        String variableName,
                        Map<String,Object> variables)

  - ### Method Detail

    - #### getRowCount

          public long getRowCount()

      Description copied from class: `NodeSequence`
      Get the number of rows in this sequence. If the actual number of rows is not known, this method returns -1.
      Specified by:
        `getRowCount` in class `NodeSequence`
      Returns:
        the number of rows, or -1 if the number of rows is not known or cannot be found with significant overhead

    - #### width

          public int width()

      Description copied from class: `NodeSequence`
      Get the number of nodes in each row.
      Specified by:
        `width` in class `NodeSequence`
      Returns:
        the width of each row; always positive

    - #### isEmpty

          public boolean isEmpty()

      Description copied from class: `NodeSequence`
      Determine whether this results is known to be empty.
      Specified by:
        `isEmpty` in class `NodeSequence`
      Returns:
        the true if there are no results, or false if there is at least some or if the number of rows is not known

    - #### nextBatch

          public NodeSequence.Batch nextBatch()

      Description copied from class: `NodeSequence`
      Get the next batch of `NodeKey` instances.
      Specified by:
        `nextBatch` in class `NodeSequence`
      Returns:
        the next batch, or null if there are no more batches.

    - #### initialize

          protected void initialize()

    - #### close

          public void close()

      Description copied from class: `NodeSequence`
      Signal that this node sequence is no longer needed.
      Specified by:
        `close` in class `NodeSequence`

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