|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.datatools.sqltools.sqlbuilder.model.UpdateHelper
public class UpdateHelper
Helper class for UpdateStatement
Constructor Summary | |
---|---|
UpdateHelper()
|
Method Summary | |
---|---|
static void |
addColumn(QueryUpdateStatement statement,
Column column)
Creates an UpdateAssinmentExpression which contains the given Column and its default value, and adds it to the list of assignment expressions in the given update statement |
static void |
addColumn(QueryUpdateStatement statement,
ValueExpressionColumn valueExprCol,
QueryValueExpression valueExpr)
Creates an UpdateAssignmentExpression which contains the given ValueExpressionColumn and its QueryValueExpression and add it to the list of assignment expressions to the QueryUpdateStatement |
static void |
addColumns(QueryUpdateStatement statement,
java.util.List columns)
Creates an UpdateAssinmentExpression which contains the given list of Columns and their default values, and adds it to the list of assignment expressions in the given update statement |
static void |
clearAssignmentExprList(QueryUpdateStatement statement)
|
static void |
clearStatementContents(QueryUpdateStatement stmt)
Clears the contents of the given update statement.Containments which are objects, are set to null and containments which are lists, are cleared. |
static void |
createUpdateSourceExpressionList(UpdateAssignmentExpression assignExpr,
ValueExpressionColumn column,
QueryValueExpression valueExpr)
Creates an UpdateSourceExpressionList which contains the given QueryValueExpression for the given column and adds it to the given AssignmentExpression |
static void |
createUpdateSourceQuery(UpdateAssignmentExpression assignExpr,
QueryExpressionBody query)
Creates an UpdateSourceQuery which contains the given QueryExpressionBody, and adds it to the given AssignmentExpression |
static UpdateAssignmentExpression |
getAssignmentExprForColumn(QueryUpdateStatement statement,
ValueExpressionColumn column)
Returns the UpdateAssignmentExpression from the given update statement, which contains the given column |
static ValueExpressionColumn |
getColumnExpressionForName(QueryUpdateStatement statement,
java.lang.String columnName)
Looks for a ValueExpressionColumn in the list of assignment expressions in the given statement, with name same as the given name |
static QueryValueExpression |
getDefaultColumnValue(Column column)
|
static java.util.List |
getTargetColumns(QueryUpdateStatement statement)
Returns the list of columns that the given update statement modifies |
static QueryValueExpression |
getValueForColumn(QueryUpdateStatement statement,
ValueExpressionColumn column)
Gets a QueryValueExpression in a statement corresponding to the given column |
static void |
refresh(QueryUpdateStatement stmt)
Refreshes the model that ultimately refreseh the UI, this is temporary. |
static void |
removeColumn(QueryUpdateStatement statement,
Column column)
This is a wrapper method around removeColumn(QueryUpdateStatement statement,ValueExpressionColumn column) in this class |
static void |
removeColumn(QueryUpdateStatement statement,
ValueExpressionColumn column)
Removes the given ValueExpressionColumn from the UpdateAssignmentExpression containing it, in the given update statement.If the removed column is the only column in the target column list of the assignment expression then UpdateAssignmentExpression is removed from the list of assignment expressions in the update statement |
static void |
removeTableFromStatement(QueryUpdateStatement statement)
Removes sets the target table of the given Update statement to null |
static void |
replaceStatementContents(QueryUpdateStatement oldStmt,
QueryUpdateStatement newStmt)
Replaces the containments in one update statement with the containments in another update statement |
static void |
setTargetTable(QueryUpdateStatement statement,
TableInDatabase targetTable)
Sets the target TableExpression of the given Update statement |
static void |
setValueForColumn(UpdateSourceExprList source,
ValueExpressionColumn column,
QueryValueExpression value)
Updates the value of the given column in the given UpdatesourceExpressionList |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UpdateHelper()
Method Detail |
---|
public static void clearAssignmentExprList(QueryUpdateStatement statement)
statement
- public static java.util.List getTargetColumns(QueryUpdateStatement statement)
statement
- the given update statement
public static UpdateAssignmentExpression getAssignmentExprForColumn(QueryUpdateStatement statement, ValueExpressionColumn column)
statement
- the update statementcolumn
- the column for which the assisnment expression is to be found
public static void removeColumn(QueryUpdateStatement statement, ValueExpressionColumn column)
statement
- the QueryUpdateStatement from which the given column is removedcolumn
- the ValueExpressionColumn being removedpublic static void removeColumn(QueryUpdateStatement statement, Column column)
statement
- the QueryUpdateStatement from which the given column is removedcolumn
- the Column to be removedpublic static void replaceStatementContents(QueryUpdateStatement oldStmt, QueryUpdateStatement newStmt)
oldStmt
- statement in which the containments are being replacednewStmt
- statement whose contents are used to replace contents in oldStmtpublic static void addColumn(QueryUpdateStatement statement, Column column)
statement
- the update statement being modifiedcolumn
- the column being addedpublic static void addColumn(QueryUpdateStatement statement, ValueExpressionColumn valueExprCol, QueryValueExpression valueExpr)
statement
- the update statement to which the UpdateAssignmentExpression will
be assignedvalueExprCol
- the ValueExpressionColumn being addedvalueExpr
- the QueryValueExpression associated with valueExprColpublic static void addColumns(QueryUpdateStatement statement, java.util.List columns)
statement
- the update statement being modifiedcolumns
- the list of Columns being added to the statementpublic static QueryValueExpression getDefaultColumnValue(Column column)
public static QueryValueExpression getValueForColumn(QueryUpdateStatement statement, ValueExpressionColumn column)
statement
- the statement from which the value is to be searchedcolumn
- the column for which the value is to be searched for
public static ValueExpressionColumn getColumnExpressionForName(QueryUpdateStatement statement, java.lang.String columnName)
statement
- the statement on which the search needs to be performedcolumnName
- the name of the ValueExpressionColumn to search for
public static void removeTableFromStatement(QueryUpdateStatement statement)
statement
- the update statementpublic static void setValueForColumn(UpdateSourceExprList source, ValueExpressionColumn column, QueryValueExpression value)
source
- the UpdatesourceExpressionList containing the value for the columncolumn
- the column for which the value is to be updatedvalue
- the new valuepublic static void clearStatementContents(QueryUpdateStatement stmt)
stmt
- the statement being modifiedpublic static void setTargetTable(QueryUpdateStatement statement, TableInDatabase targetTable)
statement
- the statement to be modifiedtargetTable
- the new TargetTableExpressionpublic static void refresh(QueryUpdateStatement stmt)
stmt
- the QueryUpdateStatement which needs to be refreshedpublic static void createUpdateSourceQuery(UpdateAssignmentExpression assignExpr, QueryExpressionBody query)
assignExpr
- the update assignment expression to be modifiedquery
- the query expression body to connect to the assignment expression.public static void createUpdateSourceExpressionList(UpdateAssignmentExpression assignExpr, ValueExpressionColumn column, QueryValueExpression valueExpr)
assignExpr
- the update assignment expression to be modifiedcolumn
- the column for the expression.query
- the query value expression to connect to the assignment expression.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |