Package 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 Description PreparedStatementPartImpl()Default constructor, creates an empty PreparedStatementPart.PreparedStatementPartImpl(String sql, Object... preparedStatementReplacements)Constructor, creates a pre-filled PreparedStatementPartImpl.PreparedStatementPartImpl(PreparedStatementPart toCopy)Copy-Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PreparedStatementPartImplappend(PreparedStatementPart toAppend)Appends another PreparedStatementPart to this part.PreparedStatementPartImplappend(SqlEnum toAppend)Appends a SqlEnum to this part.booleanequals(Object obj)List<Object>getPreparedStatementReplacements()Returns the list of prepared statement replacements.StringBuildergetSql()Returns the SQL of the part.StringgetSqlAsString()Returns the SQL of the part as String.inthashCode()StringtoString()
-
-
-
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:
getSqlAsStringin interfacePreparedStatementPart- Returns:
- the SQL, not null.
-
getPreparedStatementReplacements
public List<Object> getPreparedStatementReplacements()
Returns the list of prepared statement replacements.- Specified by:
getPreparedStatementReplacementsin interfacePreparedStatementPart- 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).
-
-