Package com.laamella.queryprutser.common

Examples of com.laamella.queryprutser.common.SeparatedStringBuilder


    add("ON " + joinOn);
    return this;
  }

  public FromClause using(final String... columns) {
    add(new SeparatedStringBuilder("USING (", ", ", ")").add(columns).toCharSequence());
    return this;
  }
View Full Code Here


    return subquery;
  }

  @Override
  public String toString() {
    final SeparatedStringBuilder locallCopy = new SeparatedStringBuilder(this);
    for (final Subquery builder : subqueries) {
      locallCopy.add(" " + builder.queryText() + " ");
    }
    return locallCopy.toString();
  }
View Full Code Here

    return subselect(rootClass, null);
  }

  @Override
  public String toString() {
    final SeparatedStringBuilder locallCopy = new SeparatedStringBuilder(this);
    for (final Subquery<?> builder : subqueries) {
      locallCopy.add(" " + builder.queryText() + " ");
    }
    return locallCopy.toString();
  }
View Full Code Here

public class SeparatedStringBuilderTest {

  @Test
  public void whenNotAppendingAnythingThenResultIsEmpty() {
    final SeparatedStringBuilder string = new SeparatedStringBuilder("pre", "in", "post");
    assertEquals("", string.toString());
  }
View Full Code Here

    assertEquals("", string.toString());
  }

  @Test
  public void whenAppendingOneThingThenPreAndPostfixAreAdded() {
    final SeparatedStringBuilder string = new SeparatedStringBuilder("pre", "in", "post");
    string.add("text");
    assertEquals("pretextpost", string.toString());
  }
View Full Code Here

    assertEquals("pretextpost", string.toString());
  }

  @Test
  public void whenAppendingSeveralThingsThenPreInAndPostfixAreAdded() {
    final SeparatedStringBuilder string = new SeparatedStringBuilder("pre", "in", "post");
    string.add("text1", "text2", "text3");
    assertEquals("pretext1intext2intext3post", string.toString());
  }
View Full Code Here

TOP

Related Classes of com.laamella.queryprutser.common.SeparatedStringBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.