@Test public void prependToWithOneColumn_prependsProperSql() { ColumnsImpl columns = new ColumnsImpl(new Column[] {new ColumnImpl("a")}, mock(SqlPart.class)); RawSqlBuilder builder = new RawSqlBuilderImpl(); columns.prependTo(builder); assertThat(builder.toString(), is("(a)")); }
@Override public void prependTo(@NotNull final RawSqlBuilder builder) { builder.prepend(')'); for (int i = mColumns.length - 1; i >= 0; i--) { mColumns[i].prependTo(builder); if (i > 0) { builder.prepend(','); } } builder.prepend('('); }
ColumnsImpl extends BaseFinishedStatement implements CreateColumns { @Override public void prependTo(@NotNull final RawSqlBuilder builder) { builder.prepend(')'); for (int i = mColumns.length - 1; i >= 0; i--) { mColumns[i].prependTo(builder); if (i > 0) { builder.prepend(','); } } builder.prepend('('); } }
ColumnsImpl extends BaseFinishedStatement implements CreateColumns { @Override public void prependTo(@NotNull final RawSqlBuilder builder) { builder.prepend(')'); for (int i = mColumns.length - 1; i >= 0; i--) { mColumns[i].prependTo(builder); if (i > 0) { builder.prepend(','); } } builder.prepend('('); } ColumnsImpl(@NotNull final Column[] columns, @NotNull final SqlPart previous); }
ColumnsImpl extends BaseFinishedStatement implements CreateColumns { @Override public void prependTo(@NotNull final RawSqlBuilder builder) { builder.prepend(')'); for (int i = mColumns.length - 1; i >= 0; i--) { mColumns[i].prependTo(builder); if (i > 0) { builder.prepend(','); } } builder.prepend('('); } ColumnsImpl(@NotNull final Column[] columns, @NotNull final SqlPart previous); @NotNull @Override WithoutRowId withoutRowId(); @Override void prependTo(@NotNull final RawSqlBuilder builder); @Nullable @Override SqlPart previous(); }
ColumnsImpl extends BaseFinishedStatement implements CreateColumns { @Override public void prependTo(@NotNull final RawSqlBuilder builder) { builder.prepend(')'); for (int i = mColumns.length - 1; i >= 0; i--) { mColumns[i].prependTo(builder); if (i > 0) { builder.prepend(','); } } builder.prepend('('); } ColumnsImpl(@NotNull final Column[] columns, @NotNull final SqlPart previous); @NotNull @Override WithoutRowId withoutRowId(); @Override void prependTo(@NotNull final RawSqlBuilder builder); @Nullable @Override SqlPart previous();  }