Package com.laamella.queryprutser.sql

Source Code of com.laamella.queryprutser.sql.FromClause

package com.laamella.queryprutser.sql;

import com.laamella.queryprutser.common.SeparatedStringBuilder;

public class FromClause extends ClauseWithSubselects {
  FromClause() {
    super("FROM ", " ", " ");
  }

  public FromClause crossJoin(final String table) {
    add("CROSS JOIN " + table);
    return this;
  }

  public FromClause innerJoin(final String table) {
    add("INNER JOIN " + table);
    return this;
  }

  public FromClause unionJoin(final String table) {
    add("UNION JOIN " + table);
    return this;
  }

  public FromClause join(final String table) {
    add("JOIN " + table);
    return this;
  }

  public FromClause outerJoin(final String table) {
    add("OUTER JOIN " + table);
    return this;
  }

  public FromClause leftOuterJoin(final String table) {
    add("LEFT OUTER JOIN " + table);
    return this;
  }

  public FromClause rightOuterJoin(final String table) {
    add("RIGHT OUTER JOIN " + table);
    return this;
  }

  public FromClause fullOuterJoin(final String table) {
    add("FULL OUTER JOIN " + table);
    return this;
  }

  public FromClause on(final String joinOn) {
    add("ON " + joinOn);
    return this;
  }

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

Related Classes of com.laamella.queryprutser.sql.FromClause

TOP
Copyright © 2018 www.massapi.com. 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.