org.datanucleus.store.mapped.expression
Class StatementText

java.lang.Object
  extended by org.datanucleus.store.mapped.expression.StatementText

public class StatementText
extends java.lang.Object

Representation of a snippet of an SQL statement. May contain parameters.


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
 StatementText appendParameter(JavaTypeMapping mapping, java.lang.Object value)
          Append a parameter.
 void applyParametersToStatement(ExecutionContext ec, java.lang.Object datastoreStatement)
          Method to set the parameters in the datastore statement.
 void clearStatement()
          Convenience method to reset the SQL for the statement.
 void encloseInParentheses()
          Whether to enclose this statement within parentheses
 StatementText postpend(java.lang.String s)
          Set a String to the end of the 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.


encloseInParentheses

public void encloseInParentheses()
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 StatementText appendParameter(JavaTypeMapping mapping,
                                     java.lang.Object value)
Append a parameter.

Parameters:
mapping - the mapping
value - the parameter value
Returns:
the StatementText

applyParametersToStatement

public void applyParametersToStatement(ExecutionContext ec,
                                       java.lang.Object datastoreStatement)
Method to set the parameters in the datastore statement.

Parameters:
ec - execution context
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) - which means WHAT exactly ?
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 © 2010. All Rights Reserved.