Gets the alias from a Join expression.

@deprecated
19518
public static function getJoinAlias(Join $join): string
    {
        @trigger_error(sprintf('The use of "%s::getJoinAlias()" is deprecated since 2.3 and will be removed in 3.0. Use "%s::getAlias()" directly instead.', __CLASS__, Join::class), E_USER_DEPRECATED);

        return $join->getAlias();
    }
499762
private function getFromClause()
    {
        $fromClauses = array();

        foreach ($this->parts['from'] as $from) {
            $fromClause = $from['table'];

            if ($from['alias'] !== null) {
                $fromClause .= ' '.$from['alias'];
            }

            if (isset($this->parts['join'][$from['alias']])) {
                foreach ($this->parts['join'][$from['alias']] as $join) {
                    $fromClause .= ' '.strtoupper($join['type']).
                                   ' JOIN '.$join['table'].' '.$join['alias'].
                                   ' ON '.$join['expression'];
                }
            }

            $fromClauses[] = $fromClause;
        }

        return implode(', ', $fromClauses);
    }
1208544
private function getJoinString()
    {
        // If there are not joins, return empty
        if (!count($this->orderBy)) {
            return '';
        }

        // Create join strings
        $joins = array_map(function ($join) {
            return $join['type'] . ' JOIN ' . $join['table'] . ' ON ' . $this->table . '.' . $join['first'] . $join['operator'] . $join['table'] . '.' . $join['second'];
        }, $this->joins);

        // Return complete join string
        return implode(' ', $joins);
    }
1085002
public function getFrom()
    {
        $result = [];
        $params = [];

        $refCount = $this->query->aliasRefCount;

        foreach ($this->query->tablesAliasList as $alias) {
            if (!ArrayHelper::getValue($refCount, $alias)) {
                continue;
            }

            try {
                /** @var $from BaseJoin */
                $from = ArrayHelper::getValue(
                    $this->query->tableJoinsMap,
                    $alias,
                    ArrayHelper::STRICT
                );

                list($fromSql, $fromParams) = $this->compile($from);
                array_push($result, $fromSql);

                $params = array_merge($params, $fromParams);
            } catch (KeyError $e) {
                continue;
            }
        }

        return [$result, $params];
    }
1070420
public String getAliasNameIfRelevant(GroovyExpression expr) {
        if(!(expr instanceof FunctionCallExpression)) {
            return null;
        }
        FunctionCallExpression fc = (FunctionCallExpression)expr;
        if(! fc.getFunctionName().equals(AS_METHOD)) {
            return null;
        }
       LiteralExpression aliasName =  (LiteralExpression)fc.getArguments().get(0);
       return aliasName.getValue().toString();

    }
957344
public function join_alias() {
        $this->joins[] = sprintf('LEFT JOIN {glossary_alias} %s ON %s = %s',
            self::ALIAS_ALIAS, self::resolve_field('id', 'entries'), self::resolve_field('entryid', 'alias'));
    }
987497
String getColumnName() {
        if (alias != null) { return alias; }

        if (selectExpression instanceof PropertyExpression) {
            return ((PropertyExpression) selectExpression).getColumnName();
        }
        if (selectExpression instanceof MetaExpression) {
            return ((MetaExpression) selectExpression).getColumnName();
        }

        return null;
    }
113882
@Override
    public String matchPredicateOperand(String alias) {
        Objects.requireNonNull(alias, "alias cannot be null");
        // alias.identifier
        return alias + "." + idFieldName;
    }
927055
protected function translateJoin(JoinClause $join, Schema &$schema) {
		$expr = $join->getJoinType() . ' ';
		
		//build condition expression
		$condition = $join->getCondition();
		if ($condition instanceof SQLPredicate)
			$condition = $condition->evaluate($this->driver, $schema);
		elseif (!is_string($condition))
			throw new \InvalidArgumentException("Conditions must be specified either by a SQLPredicate instance or a non-empty string");

		//build join expression
		if ($join->getAlias())
			$expr .= '@@' . $join->getTable() . ' ' . $join->getAlias() . ' ON ' . $condition . ' ';
		else
			$expr .= '@@' . $join->getTable() .  ' ON ' . $condition . ' ';
	
		return $expr;
	}
1279876
function extractAlias(nameAndAlias) {
        var tokens;
        tokens = nameAndAlias.split(' AS ');
        return {
            id: tokens[0].trim(),
            alias: tokens[1] ? tokens[1].trim() : undefined
        };
    }
501880
private static String alias(SqlNode item) {
		assert item instanceof SqlCall;
		assert item.getKind() == SqlKind.AS;
		final SqlIdentifier identifier = ((SqlCall) item).operand(1);
		return identifier.getSimple();
	}
167080
public function leftJoin($fromAlias, $join, $alias, $condition = null)
    {
        $this->_dbPending[] = [
            'name' => 'leftJoin',
            'args' => [
                $fromAlias,
                $join,
                $alias,
                $condition
            ],
        ];

        return $this;
    }
1071828
function getPathFromMemberExpression(expr, acc = []) {
  if (expr.type === "Identifier") {
    return acc.concat(expr.name);
  } else if (expr.type === "MemberExpression") {
    return acc.concat(getPathFromMemberExpression(expr.object, acc)).concat(expr.property.name);
  } else {
    throw new Error(`Expected MemberExpression or Identifier but get ${expr.type}.`);
  }
}
831530
function (sql) {
            if (this._joinedDataset) {
                return format(" %s FROM %s%s", this._sourceList(this.__opts.from[0]), this._sourceList(this.__opts.from), this._selectJoinSql());
            } else {
                return this._super(arguments);
            }
        }
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);
            }

        }
    }
549832
public function joinString($join=null, $glue=", ")
    {
        $join = LambdaUtils::toSelectCallable($join);
        $temp = $this->select($join)->toArray();
        return implode($glue, $temp);
    }
1140615
protected List<String> getEdges(String join) {
        List<String> results = new ArrayList<>();
        for (Many2ManyAssociation a : many2ManyAssociations) {
            if (a.getJoin().equalsIgnoreCase(join)) {
                results.add(getMetaModel(a.getSourceClass()).getTableName());
                results.add(getMetaModel(a.getTargetClass()).getTableName());
            }
        }
        return results;
    }