org.jpox.store.mapped.query
Class StatementText

java.lang.Object
  extended by org.jpox.store.mapped.query.StatementText

public class StatementText
extends java.lang.Object

Representation of a statement.

Version:
$Revision: 1.1 $

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.
 void setParameters(ObjectManager om, java.lang.Object datastoreStatement)
          Method to set the parameters in the datastore statement.
 java.lang.String toStatementString(int mode)
          Accessor for the SQL of the statement.
 java.lang.String toString()
          Accessor for the string form of the statement.
 
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

setParameters

public void setParameters(ObjectManager om,
                          java.lang.Object datastoreStatement)
Method to set the parameters in the datastore statement.

Parameters:
om - ObjectManager
datastoreStatement - The datastore "statement"

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()
Accessor for the string form of the statement.

Overrides:
toString in class java.lang.Object
Returns:
String form of the statement


Copyright © -2008 . All Rights Reserved.