|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.rdbms.sql.SQLText
public class SQLText
Representation of a snippet of an SQL statement. May contain parameters. A 'parameter' in this context is an input parameter to the query (which will map on to a JDBC '?' in the resultant SQL). Call "applyParametersToStatement()" to set the parameter values in the PreparedStatement.
| Constructor Summary | |
|---|---|
SQLText()
Constructor |
|
SQLText(String initialSQLText)
Constructor |
|
| Method Summary | |
|---|---|
SQLText |
append(char c)
Append a character to the SQL. |
SQLText |
append(SQLExpression expr)
Append an SQLExpression. |
SQLText |
append(SQLStatement stmt)
Append an SQLStatement. |
SQLText |
append(SQLText st)
Append a SQLText |
SQLText |
append(String s)
Append some SQL as a string. |
SQLText |
appendParameter(String name,
org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping,
Object value)
Append a parameter represented by a mapping (single datastore column). |
SQLText |
appendParameter(String name,
org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping,
Object value,
int columnNumber)
Append a parameter represented by a mapping, for a column of a multi-column mapping. |
void |
applyParametersToStatement(org.datanucleus.store.ExecutionContext ec,
PreparedStatement ps)
Method to set the parameters in the supplied PreparedStatement using their mappings and provided values. |
void |
changeMappingForParameter(String parameterName,
org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping)
Convenience method to change the mapping used for a parameter, if it is referenced by this SQL text object. |
void |
clearStatement()
Convenience method to reset the SQL for the statement. |
void |
encloseInParentheses()
Set to enclose this SQL in parentheses. |
List<SQLStatementParameter> |
getParametersForStatement()
Accessor for the parameters for this SQLText (including all sub SQLText) |
SQLText |
postpend(String s)
Set the String to append at the end of the SQL. |
SQLText |
prepend(String s)
Prepend some SQL as a string. |
String |
toSQL()
Accessor for the SQL of the statement. |
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 |
|---|
public SQLText()
public SQLText(String initialSQLText)
initialSQLText - | Method Detail |
|---|
public void clearStatement()
public void encloseInParentheses()
public SQLText postpend(String s)
s - the string
public SQLText prepend(String s)
s - The string
public SQLText append(char c)
c - the char
public SQLText append(String s)
s - the String
public SQLText append(SQLStatement stmt)
stmt - the SQL Statement
public SQLText append(SQLText st)
st - the SQLText
public SQLText append(SQLExpression expr)
expr - the SQLExpression
public SQLText appendParameter(String name,
org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping,
Object value)
name - The parameter namemapping - the mappingvalue - the parameter value
public SQLText appendParameter(String name,
org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping,
Object value,
int columnNumber)
name - The parameter namemapping - the mappingvalue - the parameter valuecolumnNumber - Number of the column represented here
public void changeMappingForParameter(String parameterName,
org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping)
parameterName - Name of the parametermapping - The mapping to use instead
public void applyParametersToStatement(org.datanucleus.store.ExecutionContext ec,
PreparedStatement ps)
ec - execution contextps - The PreparedStatementpublic List<SQLStatementParameter> getParametersForStatement()
public String toSQL()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||