Package org.hsqldb_voltpatches.HsqlNameManager

Examples of org.hsqldb_voltpatches.HsqlNameManager.SimpleName


    }

    protected RangeVariable readSimpleRangeVariable(int operation) {

        Table      table = readTableName();
        SimpleName alias = null;

        if (operation != StatementTypes.DELETE_WHERE) {
            if (token.tokenType == Tokens.AS) {
                read();
                checkIsNonCoreReservedIdentifier();
View Full Code Here


     * Creates a RangeVariable from the parse context. <p>
     */
    protected RangeVariable readTableOrSubquery() {

        Table          table            = null;
        SimpleName     alias            = null;
        OrderedHashSet columnList       = null;
        BitMap         columnNameQuoted = null;
        SimpleName[]   columnNameList   = null;

        if (token.tokenType == Tokens.OPENBRACKET) {
            Expression e = XreadTableSubqueryOrJoinedTable();

            table = e.subQuery.getTable();
            if (table instanceof TableDerived) {
                ((TableDerived)table).dataExpression = e;
            }
        } else {
            table = readTableName();

            if (table.isView()) {
                SubQuery sq = getViewSubquery((View) table);

//                sq.queryExpression = ((View) table).queryExpression;
                table = sq.getTable();
            }
        }

        boolean hasAs = false;

        if (token.tokenType == Tokens.AS) {
            read();
            checkIsNonCoreReservedIdentifier();

            hasAs = true;
        }

        if (isNonCoreReservedIdentifier()) {
            boolean limit = token.tokenType == Tokens.LIMIT
                            || token.tokenType == Tokens.OFFSET;
            int position = getPosition();

            alias = HsqlNameManager.getSimpleName(token.tokenString,
                                                  isDelimitedIdentifier());

            read();

            if (token.tokenType == Tokens.OPENBRACKET) {
                columnNameQuoted = new BitMap(32);
                columnList       = readColumnNames(columnNameQuoted, false);
            } else if (!hasAs && limit) {
                if (token.tokenType == Tokens.QUESTION
                        || token.tokenType == Tokens.X_VALUE) {
                    alias = null;

                    rewind(position);
                }
            }
        }

        if (columnList != null) {
            if (table.getColumnCount() != columnList.size()) {
                throw Error.error(ErrorCode.X_42593);
            }

            columnNameList = new SimpleName[columnList.size()];

            for (int i = 0; i < columnList.size(); i++) {
                SimpleName name =
                    HsqlNameManager.getSimpleName((String) columnList.get(i),
                                                  columnNameQuoted.isSet(i));

                columnNameList[i] = name;
            }
View Full Code Here

        switch (opType) {

            case OpTypes.COALESCE :
            case OpTypes.COLUMN : {
                for (int i = 0; i < length; i++) {
                    SimpleName aliasName = columns[i].alias;
                    String     alias     = aliasName == null ? null
                                                             : aliasName.name;

                    if (schema == null && tableName == null
                            && columnName.equals(alias)) {
View Full Code Here

        for (int i = 0; i < indexLimitVisible; i++) {
            Expression expression = exprColumns[i];
            String     alias      = expression.getAlias();

            if (alias.length() == 0) {
                SimpleName name = HsqlNameManager.getAutoColumnName(i);

                expression.setAlias(name);

                continue;
            }
View Full Code Here

                    : TableBase.RESULT_TABLE;
        columnList = new HashMappedList();

        for (int i = 0; i < indexLimitVisible; i++) {
            Expression e          = exprColumns[i];
            SimpleName simpleName = e.getSimpleName();
            String     nameString = simpleName.name;
            HsqlName name =
                session.database.nameManager.newColumnSchemaHsqlName(tableName,
                    simpleName);
View Full Code Here

        }
    }

    String getColumnAlias(int i) {

        SimpleName name = getColumnAliasName(i);

        return name.name;
    }
View Full Code Here

TOP

Related Classes of org.hsqldb_voltpatches.HsqlNameManager.SimpleName

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.