org.apache.torque.sql.objectbuilder

## Class PreparedStatementPartForSubselect

- java.lang.Object
- - org.apache.torque.sql.objectbuilder.PreparedStatementPartForSubselect

- All Implemented Interfaces:
    PreparedStatementPart

      public class PreparedStatementPartForSubselect
      extends Object
      implements PreparedStatementPart

  A PreparedStatementPart which encapsulates a subselect. The SQL and Replacements are not calculated immediately, but wait for the outer clause to be completed, as tables in the from clause which reference tables in the outer select are removed, and this can only be done when the outer query is known. This only works if the methofs getSqlAsString() and getPreparedStatementReplacements() are called after the outer query is calculated.
  Version:
    $Id: $

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PreparedStatementPartForSubselect(Criteria toBuildFrom, Query outerQuery)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<Object>` | `getPreparedStatementReplacements()` Returns the list of prepared statement replacements.
    `String` | `getSqlAsString()` Returns the SQL of the part as String.

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

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

- - ### Constructor Detail

    - #### PreparedStatementPartForSubselect

          public PreparedStatementPartForSubselect(Criteria toBuildFrom,
                                                   Query outerQuery)

      Constructor.
      Parameters:
        `toBuildFrom` - The criteria to build the subselect from.
        `outerQuery` - The outer query in which this subselect is embedded.

  - ### Method Detail

    - #### getSqlAsString

          public String getSqlAsString()

      Returns the SQL of the part as String.
      Specified by:
        `getSqlAsString` in interface `PreparedStatementPart`
      Returns:
        the SQL, not null.

    - #### getPreparedStatementReplacements

          public List<Object> getPreparedStatementReplacements()

      Returns the list of prepared statement replacements. The implementation may or may not return a list which is modifiable and which may or may not, in case of modification, change the internal state of the surrounding PreparedStatementPart.
      Specified by:
        `getPreparedStatementReplacements` in interface `PreparedStatementPart`
      Returns:
        the list of prepared statement replacements, not null.

Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.