org.apache.torque.criteria

## Class PreparedStatementPartImpl

- java.lang.Object
- - org.apache.torque.criteria.PreparedStatementPartImpl

- All Implemented Interfaces:
    Serializable, PreparedStatementPart

      public class PreparedStatementPartImpl
      extends Object
      implements PreparedStatementPart, Serializable

  Modifiable implementation of the PreparedStatementPart interface.
  Version:
    $Id: PreparedStatementPart.java 1701510 2015-09-06 18:45:05Z tfischer $
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PreparedStatementPartImpl()` Default constructor, creates an empty PreparedStatementPart.
    `PreparedStatementPartImpl(PreparedStatementPart toCopy)` Copy-Constructor.
    `PreparedStatementPartImpl(String sql, Object... preparedStatementReplacements)` Constructor, creates a pre-filled PreparedStatementPartImpl.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `PreparedStatementPartImpl` | `append(PreparedStatementPart toAppend)` Appends another PreparedStatementPart to this part.
    `PreparedStatementPartImpl` | `append(SqlEnum toAppend)` Appends a SqlEnum to this part.
    `boolean` | `equals(Object obj)`
    `List<Object>` | `getPreparedStatementReplacements()` Returns the list of prepared statement replacements.
    `StringBuilder` | `getSql()` Returns the SQL of the part.
    `String` | `getSqlAsString()` Returns the SQL of the part as String.
    `int` | `hashCode()`
    `String` | `toString()`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### PreparedStatementPartImpl

          public PreparedStatementPartImpl()

      Default constructor, creates an empty PreparedStatementPart.

    - #### PreparedStatementPartImpl

          public PreparedStatementPartImpl(String sql,
                                           Object... preparedStatementReplacements)

      Constructor, creates a pre-filled PreparedStatementPartImpl.
      Parameters:
        `sql` - The sql to fill into the sql buffer initially, or null.
        `preparedStatementReplacements` - the prepared statement replacements to start with, or null.

    - #### PreparedStatementPartImpl

          public PreparedStatementPartImpl(PreparedStatementPart toCopy)

      Copy-Constructor.
      Parameters:
        `toCopy` - the PreparedStatementPart to copy, not null.

  - ### Method Detail

    - #### getSql

          public StringBuilder getSql()

      Returns the SQL of the part.
      Returns:
        the SQL as mutable StringBuilder, not null.

    - #### 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.
      Specified by:
        `getPreparedStatementReplacements` in interface `PreparedStatementPart`
      Returns:
        the modifiable list of prepared statement replacements, not null.

    - #### append

          public PreparedStatementPartImpl append(PreparedStatementPart toAppend)

      Appends another PreparedStatementPart to this part.
      Parameters:
        `toAppend` - the part to append, not null.
      Returns:
        this PreparedStatementPart (with toAppend appended).

    - #### append

          public PreparedStatementPartImpl append(SqlEnum toAppend)

      Appends a SqlEnum to this part.
      Parameters:
        `toAppend` - the part to append, not null.
      Returns:
        this PreparedStatementPart (with toAppend appended).

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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