Appends to the statement table and all tables joined to it.
@param alias the table alias
@param where append conditions for WHERE clause here
763085
protected void appendTableWithJoins(TableAlias alias, StringBuffer where, StringBuffer buf)
    {
        int stmtFromPos = 0;
        byte joinSyntax = getJoinSyntaxType();

        if (joinSyntax == SQL92_JOIN_SYNTAX)
        {
            stmtFromPos = buf.length(); // store position of join (by: Terry Dexter)
        }

        if (alias == getRoot())
        {
            // BRJ: also add indirection table to FROM-clause for MtoNQuery 
            if (getQuery() instanceof MtoNQuery)
            {
                MtoNQuery mnQuery = (MtoNQuery)m_query; 
                buf.append(getTableAliasForPath(mnQuery.getIndirectionTable(), null).getTableAndAlias());
                buf.append(", ");
            }           
            buf.append(alias.getTableAndAlias());
        }
        else if (joinSyntax != SQL92_NOPAREN_JOIN_SYNTAX)
        {
            buf.append(alias.getTableAndAlias());
        }

        if (!alias.hasJoins())
        {
            return;
        }

        for (Iterator it = alias.iterateJoins(); it.hasNext();)
        {
            Join join = (Join) it.next();

            if (joinSyntax == SQL92_JOIN_SYNTAX)
            {
                appendJoinSQL92(join, where, buf);
                if (it.hasNext())
                {
                    buf.insert(stmtFromPos, "(");
                    buf.append(")");
                }
            }
            else if (joinSyntax == SQL92_NOPAREN_JOIN_SYNTAX)
            {
                appendJoinSQL92NoParen(join, where, buf);
            }
            else
            {
                appendJoin(where, buf, join);
            }

        }
    }
390141
private void appendBetweenCriteria(TableAlias alias, PathInfo pathInfo, BetweenCriteria c, StringBuffer buf)
    {
        appendColName(alias, pathInfo, c.isTranslateAttribute(), buf);
        buf.append(c.getClause());
        appendParameter(c.getValue(), buf);
        buf.append(" AND ");
        appendParameter(c.getValue2(), buf);
    }
661563
public OqlBuilder<T> join(final String joinMode, final String path, final String alias) {
    from = concat(from, " ", joinMode, " join ", path, " ", alias);
    return this;
  }
1189940
@NonNull
  public BatchStatementBuilder addStatements(@NonNull BatchableStatement<?>... statements) {
    return addStatements(Arrays.asList(statements));
  }
1256897
public void insert( Token where , Token token ) {
        if( where == null ) {
            // put at the front of the list
            if( size == 0 )
                push(token);
            else {
                first.previous = token;
                token.previous = null;
                token.next = first;
                first = token;
                size++;
            }
        } else if( where == last || null == last ) {
            push(token);
        } else {
            token.next = where.next;
            token.previous = where;
            where.next.previous = token;
            where.next = token;
            size++;
        }
    }
966469
private function setManyToManyJoin($table, $alias, $condition = null)
    {
        if (!in_array($alias, $this->tables)) {
            if ($condition) {
                $this->queryBuilder->join($table, $alias, 'WITH', $condition);
            } else {
                $this->queryBuilder->join($table, $alias);
            }
            $this->tables[] = $alias;
        }
    }
247736
public With andWith(final String alias, final Expression expression) {
        this.clauses.add(new ImmutablePair<>(new Name(alias), expression));
        return this;
    }
1114151
public function addFrom($table, $alias = null)
    {
        if ($alias) {
            $this->_tables[$alias] = $table;
        } else {
            $this->_tables[] = $table;
        }

        return $this;
    }
139055
protected void appendWhereClause(StringBuffer stmt, Object[] columns)
    {
        stmt.append(" WHERE ");

        for (int i = 0; i < columns.length; i++)
        {
            if (i > 0)
            {
                stmt.append(" AND ");
            }
            stmt.append(columns[i]);
            stmt.append("=?");
        }
    }
688718
public void append(final Filter query) {
        switch (this.queryType) {
            case OR: {
                this.orFilter.or(query);
            }
            break;

            default:
            case AND: {
                this.andFilter.and(query);
            }
            break;
        }
    }
348420
void addWhereClause(StringBuilder builder) {
        if (!getKunderaQuery().getFilterClauseQueue().isEmpty()) {
            builder.append(CQLTranslator.ADD_WHERE_CLAUSE);
        }
    }
43535
public void append2SQLSelect(final SQLSelect _sqlSelect)
    {
        if (iWhere != null) {
            final SQLWhere sqlWhere = _sqlSelect.getWhere();
            for (final IWhereTerm<?> term : iWhere.getTerms()) {
                if (term instanceof IWhereElementTerm) {
                    final IWhereElement element = ((IWhereElementTerm) term).getElement();
                    if (element.getAttribute() != null)
                    {
                        final String attrName = element.getAttribute();
                        for (final Type type : types) {
                            final Attribute attr = type.getAttribute(attrName);
                            if (attr != null) {
                                addAttr(_sqlSelect, sqlWhere, attr, term, element);
                                break;
                            }
                        }
                    } else if (element.getSelect() != null) {
                        final IWhereSelect select = element.getSelect();
                        for (final ISelectElement ele : select.getElements()) {
                            if (ele instanceof IBaseSelectElement) {
                                switch (((IBaseSelectElement) ele).getElement()) {
                                    case STATUS:
                                        for (final Type type : types) {
                                            final Attribute attr = type.getStatusAttribute();
                                            if (attr != null) {
                                                addAttr(_sqlSelect, sqlWhere, attr, term, element);
                                                break;
                                            }
                                        }
                                        break;
                                    default:
                                        break;
                                }
                            } else if (ele instanceof IAttributeSelectElement) {
                                final String attrName = ((IAttributeSelectElement) ele).getName();
                                for (final Type type : types) {
                                    addAttr(_sqlSelect, sqlWhere, type.getAttribute(attrName), term, element);
                                }
                            }
                        }
                    }
                }
            }
        }
        if (iOrder != null) {
            final SQLOrder sqlOrder = _sqlSelect.getOrder();
            for (final IOrderElement element: iOrder.getElements()) {
                for (final Type type : types) {
                    final Attribute attr = type.getAttribute(element.getKey());
                    if (attr != null) {
                        final SQLTable table = attr.getTable();
                        final String tableName = table.getSqlTable();
                        final TableIdx tableidx = _sqlSelect.getIndexer().getTableIdx(tableName);
                        sqlOrder.addElement(tableidx.getIdx(), attr.getSqlColNames(), element.isDesc());
                        break;
                    }
                }
            }
        }
    }
395925
public QueryBuilder<T, ID> join(String localColumnName, String joinedColumnName,
			QueryBuilder<?, ?> joinedQueryBuilder, JoinType type, JoinWhereOperation operation) throws SQLException {
		addJoinInfo(type, localColumnName, joinedColumnName, joinedQueryBuilder, operation);
		return this;
	}
1153695
protected function appendSortBy($sortBy, $sortMethod, QueryBuilder $queryBuilder, $alias, $locale)
    {
        foreach ($sortBy as $column) {
            if (!in_array(explode('.', $column)[0], $queryBuilder->getAllAliases())) {
                $this->appendSortByJoins($queryBuilder, $alias, $locale);
            }

            $queryBuilder->orderBy($column, $sortMethod);
        }
    }
1171983
protected void appendCriteria(TableAlias alias, PathInfo pathInfo, SelectionCriteria c, StringBuffer buf)
    {
        if (c instanceof FieldCriteria)
        {
            appendFieldCriteria(alias, pathInfo, (FieldCriteria) c, buf);
        }
        else if (c instanceof NullCriteria)
        {
            appendNullCriteria(alias, pathInfo, (NullCriteria) c, buf);
        }
        else if (c instanceof BetweenCriteria)
        {
            appendBetweenCriteria(alias, pathInfo, (BetweenCriteria) c, buf);
        }
        else if (c instanceof InCriteria)
        {
            appendInCriteria(alias, pathInfo, (InCriteria) c, buf);
        }
        else if (c instanceof SqlCriteria)
        {
            appendSQLCriteria((SqlCriteria) c, buf);
        }
        else if (c instanceof ExistsCriteria)
        {
            appendExistsCriteria((ExistsCriteria) c, buf);
        }
        else if (c instanceof LikeCriteria)
        {
            appendLikeCriteria(alias, pathInfo, (LikeCriteria) c, buf);
        }
        else
        {
            appendSelectionCriteria(alias, pathInfo, c, buf);
        }
    }
774237
protected static void appendEntityNode(String alias, EntityKeyMetadata entityKeyMetadata, StringBuilder queryBuilder) {
		appendEntityNode( alias, entityKeyMetadata, queryBuilder, 0 );
	}
989249
public TableAlias addTable(String table, String aliasPrefix) {

        String alias = makeAlias(aliasPrefix);
        m_tables.add(table + " " + alias);
        return new TableAlias(alias);

    }