(SqlWriter writer, int leftPrec, int rightPrec)
| 178 | } |
| 179 | |
| 180 | @Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) { |
| 181 | final SqlWriter.Frame frame = |
| 182 | writer.startList(SqlWriter.FrameTypeEnum.SELECT, "UPDATE", ""); |
| 183 | final int opLeft = getOperator().getLeftPrec(); |
| 184 | final int opRight = getOperator().getRightPrec(); |
| 185 | targetTable.unparse(writer, opLeft, opRight); |
| 186 | SqlIdentifier alias = this.alias; |
| 187 | if (alias != null) { |
| 188 | writer.keyword("AS"); |
| 189 | alias.unparse(writer, opLeft, opRight); |
| 190 | } |
| 191 | final SqlWriter.Frame setFrame = |
| 192 | writer.startList(SqlWriter.FrameTypeEnum.UPDATE_SET_LIST, "SET", ""); |
| 193 | for (Pair<SqlNode, SqlNode> pair |
| 194 | : Pair.zip(getTargetColumnList(), getSourceExpressionList())) { |
| 195 | writer.sep(","); |
| 196 | SqlIdentifier id = (SqlIdentifier) pair.left; |
| 197 | id.unparse(writer, opLeft, opRight); |
| 198 | writer.keyword("="); |
| 199 | SqlNode sourceExp = pair.right; |
| 200 | sourceExp.unparse(writer, opLeft, opRight); |
| 201 | } |
| 202 | writer.endList(setFrame); |
| 203 | SqlNode condition = this.condition; |
| 204 | if (condition != null) { |
| 205 | writer.sep("WHERE"); |
| 206 | condition.unparse(writer, opLeft, opRight); |
| 207 | } |
| 208 | writer.endList(frame); |
| 209 | } |
| 210 | |
| 211 | @Override public void validate(SqlValidator validator, SqlValidatorScope scope) { |
| 212 | validator.validateUpdate(this); |
nothing calls this directly
no test coverage detected