Create an alias for the expression

@return alias expression
547662
public DslExpression<R> as(Path<R> alias) {
        return Expressions.dslOperation(getType(), Ops.ALIAS, this, alias);
    }
682951
public static RAExpression alias(RAExpression re, RelationID alias, TermFactory termFactory) {
        return new RAExpression(re.dataAtoms, re.filterAtoms,
                RAExpressionAttributes.alias(re.attributes, alias), termFactory);
    }
1072981
public function getAlias()
    {
        if ($this->_alias === null) {
            $alias = namespaceSplit(get_class($this));
            $alias = substr(end($alias), 0, -5) ?: $this->_table;
            $this->_alias = $alias;
        }

        return $this->_alias;
    }
736264
public function addSelectColumn($expression, $alias = null)
    {
        if (!($expression instanceof Expression)) {
            $expression = new Expr\Column($expression);
        }
        
        $expression = $this->completeExpression($expression, $alias);
        
        $this->columns->add($expression->hashCode());
        
        return $this;
    }
1209673
public function getExpForRefName()
    {
        $value = 'CONCAT(' . self::AS_REFERRAL . '.' . Cfg::E_CUSTOMER_A_FIRSTNAME . ", ' ', " .
            self::AS_REFERRAL . '.' . Cfg::E_CUSTOMER_A_LASTNAME . ')';
        $result = new \Praxigento\Core\App\Repo\Query\Expression($value);
        return $result;
    }
1166626
private String makeAlias(String prefix) {

        int i = 0;
        String result;
        do {
            if (i == 0) {
                result = prefix;
            } else {
                result = prefix + i;
            }

        } while (m_usedAliases.contains(result));
        m_usedAliases.add(result);
        return result;

    }
956851
public function postProcessExpression(Expression $expression)
    {
        if ($this->hasHash($expression->hashCode())) {
            $alias = $this->getAlias($expression->hashCode());
            $alias = new Expr\Column($alias);
            $alias->setBuilder($this);
            $expression = new Expr\Raw(sprintf('%s AS %s', $expression->toSQL(), $alias->toSQL()));
        }
        
        return $expression;
    }
585831
public function ucase($column, string $alias = null): self
    {
        return $this->column((new Expression())->ucase($column), $alias);
    }
682333
public StringExpression trim() {
        if (trim == null) {
            trim = Expressions.stringOperation(Ops.TRIM, mixin);
        }
        return trim;
    }
495627
public function SimpleSelectExpression()
    {
        $peek = $this->lexer->glimpse();

        switch ($this->lexer->lookahead['type']) {
            case Lexer::T_IDENTIFIER:
                switch (true) {
                    case $peek['type'] === Lexer::T_DOT:
                        $expression = $this->StateFieldPathExpression();

                        return new AST\SimpleSelectExpression($expression);
                    case $peek['type'] !== Lexer::T_OPEN_PARENTHESIS:
                        $expression = $this->IdentificationVariable();

                        return new AST\SimpleSelectExpression($expression);
                    case $this->isFunction():
                        // SUM(u.id) + COUNT(u.id)
                        if ($this->isMathOperator($this->peekBeyondClosingParenthesis())) {
                            return new AST\SimpleSelectExpression($this->ScalarExpression());
                        }
                        // COUNT(u.id)
                        if ($this->isAggregateFunction($this->lexer->lookahead['type'])) {
                            return new AST\SimpleSelectExpression($this->AggregateExpression());
                        }

                        // IDENTITY(u)
                        return new AST\SimpleSelectExpression($this->FunctionDeclaration());
                    default:
                        // Do nothing
                }
                break;

            case Lexer::T_OPEN_PARENTHESIS:
                if ($peek['type'] !== Lexer::T_SELECT) {
                    // Shortcut: ScalarExpression => SimpleArithmeticExpression
                    $expression = $this->SimpleArithmeticExpression();

                    return new AST\SimpleSelectExpression($expression);
                }

                // Subselect
                $this->match(Lexer::T_OPEN_PARENTHESIS);
                $expression = $this->Subselect();
                $this->match(Lexer::T_CLOSE_PARENTHESIS);

                return new AST\SimpleSelectExpression($expression);
            default:
                // Do nothing
        }

        $this->lexer->peek();

        $expression = $this->ScalarExpression();
        $expr       = new AST\SimpleSelectExpression($expression);

        if ($this->lexer->isNextToken(Lexer::T_AS)) {
            $this->match(Lexer::T_AS);
        }

        if ($this->lexer->isNextToken(Lexer::T_IDENTIFIER)) {
            $token                             = $this->lexer->lookahead;
            $resultVariable                    = $this->AliasResultVariable();
            $expr->fieldIdentificationVariable = $resultVariable;

            // Include AliasResultVariable in query components.
            $this->queryComponents[$resultVariable] = [
                'resultvariable' => $expr,
                'nestingLevel'   => $this->nestingLevel,
                'token'          => $token,
            ];
        }

        return $expr;
    }
795627
private function _prepareExpression()
	{
		$this->expression = ($this->tableName && $this->alias) ?
			$this->tableName . '.' . $this->columnName . ' AS ' . $this->alias : (($this->tableName && !$this->alias) ?
				$this->tableName . '.' . $this->columnName : ((!$this->tableName && $this->alias) ?
					$this->columnName . ' AS ' . $this->alias : $this->columnName));
	}
461062
public function alias()
    {
        if ($this->alias === null) {
            $this->alias = strtolower(
                    preg_replace(
                    '/(?<!^)[A-Z]/', '_$0',
                    $this->getClassMetadata()->getReflectionClass()->getShortName()
                )
            );
        }

        return $this->alias;
    }
134622
public static <D> SimpleExpression<D> as(Expression<D> source, Path<D> alias) {
        if (source == null) {
            return as(Expressions.<D>nullExpression(), alias);
        } else {
            return operation(alias.getType(), Ops.ALIAS, source, alias);
        }
    }
182901
public function completeExpression(Expression $expression, $alias = null)
    {
        return $this->getBuilder()->completeExpression($expression, $alias);
    }
165568
protected function createImplodeFunction()
    {
        return new ExpressionFunction(
            'implode',
            function ($glue, $pieces) {
                return sprintf('implode(%s,%s)', $glue, $pieces);
            },
            function ($arguments, $glue, $pieces) {
                return implode($glue, $pieces);
            }
        );
    }
889481
public function NewObjectExpression()
    {
        $this->match(Lexer::T_NEW);
        $this->match(Lexer::T_IDENTIFIER);

        $token      = $this->lexer->token;
        $className  = $token['value'];

        if (strrpos($className, ':') !== false) {
            list($namespaceAlias, $simpleClassName) = explode(':', $className);

            $className = $this->em->getConfiguration()
                ->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName;
        }

        $this->match(Lexer::T_OPEN_PARENTHESIS);

        $args[] = $this->NewObjectArg();

        while ($this->lexer->isNextToken(Lexer::T_COMMA)) {
            $this->match(Lexer::T_COMMA);

            $args[] = $this->NewObjectArg();
        }

        $this->match(Lexer::T_CLOSE_PARENTHESIS);

        $expression = new AST\NewObjectExpression($className, $args);

        // Defer NewObjectExpression validation
        $this->deferredNewObjectExpressions[] = array(
            'token'        => $token,
            'expression'   => $expression,
            'nestingLevel' => $this->nestingLevel,
        );

        return $expression;
    }
1044074
public function fieldIdentifier()
    {
        $tableName = $this->table();
        $fieldName = $this->fieldName();

        return Expression::quoteIdentifier($fieldName, $tableName);
    }