net.sf.jsqlparser.statement.select
Class PlainSelect

java.lang.Object
  extended by net.sf.jsqlparser.statement.select.PlainSelect
All Implemented Interfaces:
SelectBody

public class PlainSelect
extends java.lang.Object
implements SelectBody

The core of a "SELECT" statement (no UNION, no ORDER BY)


Field Summary
private  Distinct distinct
           
private  FromItem fromItem
           
private  java.util.List groupByColumnReferences
           
private  Expression having
           
private  Table into
           
private  java.util.List joins
           
private  Limit limit
           
private  java.util.List orderByElements
           
private  java.util.List selectItems
           
private  Top top
           
private  Expression where
           
 
Constructor Summary
PlainSelect()
           
 
Method Summary
 void accept(SelectVisitor selectVisitor)
           
 Distinct getDistinct()
           
static java.lang.String getFormatedList(java.util.List list, java.lang.String expression)
           
static java.lang.String getFormatedList(java.util.List list, java.lang.String expression, boolean useComma, boolean useBrackets)
           
 FromItem getFromItem()
          The FromItem in this query
 java.util.List getGroupByColumnReferences()
          A list of ColumnReferences of the GROUP BY clause.
 Expression getHaving()
           
 Table getInto()
           
 java.util.List getJoins()
          The list of Joins
 Limit getLimit()
           
 java.util.List getOrderByElements()
           
 java.util.List getSelectItems()
          The SelectItems in this query (for example the A,B,C in "SELECT A,B,C")
static java.lang.String getStringList(java.util.List list)
          List the toString out put of the objects in the List comma separated.
static java.lang.String getStringList(java.util.List list, boolean useComma, boolean useBrackets)
          List the toString out put of the objects in the List that can be comma separated.
 Top getTop()
           
 Expression getWhere()
           
static java.lang.String orderByToString(java.util.List orderByElements)
           
 void setDistinct(Distinct distinct)
           
 void setFromItem(FromItem item)
           
 void setGroupByColumnReferences(java.util.List list)
           
 void setHaving(Expression expression)
           
 void setInto(Table table)
           
 void setJoins(java.util.List list)
           
 void setLimit(Limit limit)
           
 void setOrderByElements(java.util.List orderByElements)
           
 void setSelectItems(java.util.List list)
           
 void setTop(Top top)
           
 void setWhere(Expression where)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

distinct

private Distinct distinct

selectItems

private java.util.List selectItems

into

private Table into

fromItem

private FromItem fromItem

joins

private java.util.List joins

where

private Expression where

groupByColumnReferences

private java.util.List groupByColumnReferences

orderByElements

private java.util.List orderByElements

having

private Expression having

limit

private Limit limit

top

private Top top
Constructor Detail

PlainSelect

public PlainSelect()
Method Detail

getFromItem

public FromItem getFromItem()
The FromItem in this query

Returns:
the FromItem

getInto

public Table getInto()

getSelectItems

public java.util.List getSelectItems()
The SelectItems in this query (for example the A,B,C in "SELECT A,B,C")

Returns:
a list of SelectItems

getWhere

public Expression getWhere()

setFromItem

public void setFromItem(FromItem item)

setInto

public void setInto(Table table)

setSelectItems

public void setSelectItems(java.util.List list)

setWhere

public void setWhere(Expression where)

getJoins

public java.util.List getJoins()
The list of Joins

Returns:
the list of Joins

setJoins

public void setJoins(java.util.List list)

accept

public void accept(SelectVisitor selectVisitor)
Specified by:
accept in interface SelectBody

getOrderByElements

public java.util.List getOrderByElements()

setOrderByElements

public void setOrderByElements(java.util.List orderByElements)

getLimit

public Limit getLimit()

setLimit

public void setLimit(Limit limit)

getTop

public Top getTop()

setTop

public void setTop(Top top)

getDistinct

public Distinct getDistinct()

setDistinct

public void setDistinct(Distinct distinct)

getHaving

public Expression getHaving()

setHaving

public void setHaving(Expression expression)

getGroupByColumnReferences

public java.util.List getGroupByColumnReferences()
A list of ColumnReferences of the GROUP BY clause. It is null in case there is no GROUP BY clause

Returns:
a list of ColumnReferences

setGroupByColumnReferences

public void setGroupByColumnReferences(java.util.List list)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

orderByToString

public static java.lang.String orderByToString(java.util.List orderByElements)

getFormatedList

public static java.lang.String getFormatedList(java.util.List list,
                                               java.lang.String expression)

getFormatedList

public static java.lang.String getFormatedList(java.util.List list,
                                               java.lang.String expression,
                                               boolean useComma,
                                               boolean useBrackets)

getStringList

public static java.lang.String getStringList(java.util.List list)
List the toString out put of the objects in the List comma separated. If the List is null or empty an empty string is returned. The same as getStringList(list, true, false)

Parameters:
list - list of objects with toString methods
Returns:
comma separated list of the elements in the list
See Also:
getStringList(List, boolean, boolean)

getStringList

public static java.lang.String getStringList(java.util.List list,
                                             boolean useComma,
                                             boolean useBrackets)
List the toString out put of the objects in the List that can be comma separated. If the List is null or empty an empty string is returned.

Parameters:
list - list of objects with toString methods
useComma - true if the list has to be comma separated
useBrackets - true if the list has to be enclosed in brackets
Returns:
comma separated list of the elements in the list