Package net.sf.jsqlparser.statement.select

Examples of net.sf.jsqlparser.statement.select.SelectItem


    if (plainSelect.getDistinct() != null) {
      buffer.append("DISTINCT ");
      if (plainSelect.getDistinct().getOnSelectItems() != null) {
        buffer.append("ON (");
        for (Iterator iter = plainSelect.getDistinct().getOnSelectItems().iterator(); iter.hasNext();) {
          SelectItem selectItem = (SelectItem) iter.next();
          selectItem.accept(this);
          if (iter.hasNext()) {
            buffer.append(", ");
          }
        }
        buffer.append(") ");
      }

    }

    for (Iterator iter = plainSelect.getSelectItems().iterator(); iter.hasNext();) {
      SelectItem selectItem = (SelectItem) iter.next();
      selectItem.accept(this);
      if (iter.hasNext()) {
        buffer.append(", ");
      }
    }
View Full Code Here


    throw new Error("Missing return statement in function");
  }

  final public List SelectItemsList() throws ParseException {
        ArrayList selectItemsList = new ArrayList();
        SelectItem selectItem = null;
    selectItem = SelectItem();
                              selectItemsList.add(selectItem);
    label_10:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
View Full Code Here

  final public SelectItem SelectItem() throws ParseException {
        Function function = null;
        AllColumns allTableColumns = null;
        Column tableColumn = null;
        String alias = null;
        SelectItem selectItem = null;
        SelectExpressionItem selectExpressionItem = null;
        Expression expression = null;
        SubSelect subSelect = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case 82:
View Full Code Here

        }

        List qualifiedItems = new ArrayList();

        for (Iterator it = selectItems.iterator(); it.hasNext();) {
            SelectItem selectItem = (SelectItem) it.next();

            List items = SelectItemQualifier.qualify(session, tableAlias, selectItem);

            qualifiedItems.addAll(items);
        }
View Full Code Here

    private static String[] getColumns(ISession session, List selectItems) throws IOException {
        if (selectItems == null || selectItems.size() == 0) {
            return null;
        }

        SelectItem item;
        List colNames = new ArrayList(selectItems.size());
        for (Iterator it = selectItems.iterator(); it.hasNext();) {
            item = (SelectItem) it.next();
            if (item instanceof AllColumns) {
                continue;
            } else if (item instanceof AllTableColumns) {
                AllTableColumns allTableCols = (AllTableColumns) item;
                Table table = allTableCols.getTable();
                List tableColNames = getTableColumns(session, table);
                colNames.addAll(tableColNames);
            } else if (item instanceof SelectExpressionItem) {
                String stringItem = item.toString();
                colNames.add(stringItem);
            } else {
                throw new RuntimeException("unknown select item type: " + item);
            }
        }
View Full Code Here

TOP

Related Classes of net.sf.jsqlparser.statement.select.SelectItem

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.