Package org.hsqldb.lib

Examples of org.hsqldb.lib.HashMappedList


    }

    private HashMappedList getUnionColumns() {

        if (unionCorresponding || leftQueryExpression == null) {
            HashMappedList columns = ((TableDerived) resultTable).columnList;
            HashMappedList list    = new HashMappedList();

            for (int i = 0; i < unionColumnMap.length; i++) {
                ColumnSchema column =
                    (ColumnSchema) columns.get(unionColumnMap[i]);

                list.add(column.getName().name, column);
            }

            return list;
        }
View Full Code Here


        if (resultTable == null) {
            return leftQueryExpression.getResultColumnNames();
        }

        HashMappedList list = ((TableDerived) resultTable).columnList;
        HsqlName[]     resultColumnNames = new HsqlName[list.size()];

        for (int i = 0; i < resultColumnNames.length; i++) {
            resultColumnNames[i] = ((ColumnSchema) list.get(i)).getName();
        }

        return resultColumnNames;
    }
View Full Code Here

            ex.printStackTrace();
        }
    }

    public static HashMappedList getHashMappedList() {
        return new HashMappedList();
    }
View Full Code Here

     * Creates special users PUBLIC_USER_NAME and SYSTEM_AUTHORIZATION_NAME.
     * Sets up association with the GranteeManager for this database.
     */
    public UserManager(Database database) {
        granteeManager = database.getGranteeManager();
        userList       = new HashMappedList();
    }
View Full Code Here

    }

    void createResultTable(Session session) {

        HsqlName       tableName;
        HashMappedList columnList;
        int            tableType;

        tableName = session.database.nameManager.getSubqueryTableName();
        tableType = persistenceScope == TableBase.SCOPE_STATEMENT
                    ? TableBase.SYSTEM_SUBQUERY
View Full Code Here

    }

    private HashMappedList getUnionColumns() {

        if (unionCorresponding || leftQueryExpression == null) {
            HashMappedList columns = ((TableDerived) resultTable).columnList;
            HashMappedList list    = new HashMappedList();

            for (int i = 0; i < unionColumnMap.length; i++) {
                ColumnSchema column = (ColumnSchema) columns.get(i);

                list.add(column.getName().name, column);
            }

            return list;
        }
View Full Code Here

        if (resultTable == null) {
            return leftQueryExpression.getResultColumnNames();
        }

        HashMappedList list = ((TableDerived) resultTable).columnList;
        HsqlName[]     resultColumnNames = new HsqlName[list.size()];

        for (int i = 0; i < resultColumnNames.length; i++) {
            resultColumnNames[i] = ((ColumnSchema) list.get(i)).getName();
        }

        return resultColumnNames;
    }
View Full Code Here

        // type may have changed above for CACHED tables
        tableType         = type;
        primaryKeyCols    = null;
        primaryKeyTypes   = null;
        identityColumn    = -1;
        columnList        = new HashMappedList();
        indexList         = Index.emptyArray;
        constraintList    = Constraint.emptyArray;
        fkPath            = Constraint.emptyArray;
        fkConstraints     = Constraint.emptyArray;
        fkMainConstraints = Constraint.emptyArray;
View Full Code Here

     */
    Result executeUpdateStatement(Session session) {

        int            count          = 0;
        Expression[]   colExpressions = updateExpressions;
        HashMappedList rowset         = new HashMappedList();
        Type[]         colTypes       = baseTable.getColumnTypes();
        RangeIteratorBase it = RangeVariable.getIterator(session,
            targetRangeVariables);
        Expression checkCondition = null;

        if (targetTable != baseTable) {
            checkCondition =
                ((TableDerived) targetTable).getQueryExpression()
                    .getMainSelect().checkQueryCondition;
        }

        while (it.next()) {
            session.sessionData.startRowProcessing();

            Row      row  = it.getCurrentRow();
            Object[] data = row.getData();
            Object[] newData = getUpdatedData(session, baseTable,
                                              updateColumnMap, colExpressions,
                                              colTypes, data);

            if (checkCondition != null) {
                it.currentData = newData;

                boolean check = checkCondition.testCondition(session);

                if (!check) {
                    throw Error.error(ErrorCode.X_44000);
                }
            }

            rowset.add(row, newData);
        }

/* debug 190
        if (rowset.size() == 0) {
            System.out.println(targetTable.getName().name + " zero update: session "
View Full Code Here

        // data generated for non-matching rows
        RowSetNavigatorClient newData = new RowSetNavigatorClient(8);

        // rowset for update operation
        HashMappedList  updateRowSet       = new HashMappedList();
        RangeVariable[] joinRangeIterators = targetRangeVariables;

        // populate insert and update lists
        RangeIterator[] rangeIterators =
            new RangeIterator[joinRangeIterators.length];

        for (int i = 0; i < joinRangeIterators.length; i++) {
            rangeIterators[i] = joinRangeIterators[i].getIterator(session);
        }

        for (int currentIndex = 0; 0 <= currentIndex; ) {
            RangeIterator it          = rangeIterators[currentIndex];
            boolean       beforeFirst = it.isBeforeFirst();

            if (it.next()) {
                if (currentIndex < joinRangeIterators.length - 1) {
                    currentIndex++;

                    continue;
                }
            } else {
                if (currentIndex == 1 && beforeFirst) {
                    Object[] data = getMergeInsertData(session);

                    if (data != null) {
                        newData.add(data);
                    }
                }

                it.reset();

                currentIndex--;

                continue;
            }

            // row matches!
            if (updateExpressions != null) {
                Row row = it.getCurrentRow();    // this is always the second iterator
                Object[] data = getUpdatedData(session, baseTable,
                                               updateColumnMap,
                                               updateExpressions,
                                               baseTable.getColumnTypes(),
                                               row.getData());

                updateRowSet.add(row, data);
            }
        }

        // run the transaction as a whole, updating and inserting where needed
        // update any matched rows
        if (updateRowSet.size() > 0) {
            count = update(session, baseTable, updateRowSet);
        }

        // insert any non-matched rows
        newData.beforeFirst();
View Full Code Here

TOP

Related Classes of org.hsqldb.lib.HashMappedList

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.