org.jpox.store
Class StatementText

java.lang.Object
  extended byorg.jpox.store.StatementText

public class StatementText
extends java.lang.Object

Representation of a statement.

Version:
$Revision: 1.13 $

Constructor Summary
StatementText()
          Constructor
StatementText(java.lang.String initialStatementText)
          Constructor
 
Method Summary
 StatementText append(char c)
          Append a char
 StatementText append(QueryExpression qsc)
          Append a QueryExpression
 StatementText append(ScalarExpression expr)
          Append a ScalarExpression
 StatementText append(StatementText st, int mode)
          Append a StatementText
 StatementText append(java.lang.String s)
          Append a char
 java.lang.String appendParameter(JavaTypeMapping mapping, java.lang.Object value)
          Append a parameter
 void clearStatement()
          Convenience method to reset the SQL for the statement.
 void encloseWithInParentheses()
          Whether to enclose this statement within parentheses
 StatementText postpend(java.lang.String s)
          Set a String to the end of the statement.
 java.sql.PreparedStatement prepareStatement(PersistenceManager pm, java.sql.Connection conn)
          Generate a PreparedStatement with the default result set.
 java.sql.PreparedStatement prepareStatement(PersistenceManager pm, java.sql.Connection conn, java.lang.String resultSetType, java.lang.String resultSetConcurrency)
          Generate a PreparedStatement with the specified result set characteristics.
 java.lang.String toStatementString(int mode)
          Accessor for the SQL of the statement.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StatementText

public StatementText()
Constructor


StatementText

public StatementText(java.lang.String initialStatementText)
Constructor

Parameters:
initialStatementText -
Method Detail

clearStatement

public void clearStatement()
Convenience method to reset the SQL for the statement. This is used when updating an expression internally, and need to regenerate the statement.


encloseWithInParentheses

public void encloseWithInParentheses()
Whether to enclose this statement within parentheses


postpend

public StatementText postpend(java.lang.String s)
Set a String to the end of the statement.

Parameters:
s - the string
Returns:
the StatementText

append

public StatementText append(char c)
Append a char

Parameters:
c - the char
Returns:
the StatementText

append

public StatementText append(java.lang.String s)
Append a char

Parameters:
s - the String
Returns:
the StatementText

append

public StatementText append(QueryExpression qsc)
Append a QueryExpression

Parameters:
qsc - the QueryExpression
Returns:
the StatementText

append

public StatementText append(StatementText st,
                            int mode)
Append a StatementText

Parameters:
st - the StatementText
Returns:
the StatementText

append

public StatementText append(ScalarExpression expr)
Append a ScalarExpression

Parameters:
expr - the ScalarExpression
Returns:
the StatementText

appendParameter

public java.lang.String appendParameter(JavaTypeMapping mapping,
                                        java.lang.Object value)
Append a parameter

Parameters:
mapping - the mapping
value - the parameter value
Returns:
the generated parameter name

prepareStatement

public java.sql.PreparedStatement prepareStatement(PersistenceManager pm,
                                                   java.sql.Connection conn,
                                                   java.lang.String resultSetType,
                                                   java.lang.String resultSetConcurrency)
                                            throws java.sql.SQLException
Generate a PreparedStatement with the specified result set characteristics.

Parameters:
pm - the PersistenceManager
conn - the java.sql.Connection
resultSetType - Type of result set
resultSetConcurrency - Concurrency of result set
Returns:
the PreparedStatement
Throws:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(PersistenceManager pm,
                                                   java.sql.Connection conn)
                                            throws java.sql.SQLException
Generate a PreparedStatement with the default result set.

Parameters:
pm - the PersistenceManager
conn - the java.sql.Connection
Returns:
the PreparedStatement
Throws:
java.sql.SQLException

toStatementString

public java.lang.String toStatementString(int mode)
Accessor for the SQL of the statement.

Parameters:
mode - (0=PROJECTION;1=FILTER)
Returns:
The SQL text

toString

public java.lang.String toString()


Copyright © -2007 . All Rights Reserved.