Package org.hsqldb.navigator

Examples of org.hsqldb.navigator.RowSetNavigatorClient


        switch (type) {

            case ResultConstants.CALL_RESPONSE :
            case ResultConstants.EXECUTE :
                navigator = new RowSetNavigatorClient(1);
                break;

            case ResultConstants.UPDATE_RESULT :
                navigator = new RowSetNavigatorClient(1);
                break;

            case ResultConstants.BATCHEXECUTE :
            case ResultConstants.BATCHEXECDIRECT :
                navigator = new RowSetNavigatorClient(4);
                break;

            case ResultConstants.SETSESSIONATTR :
            case ResultConstants.PARAM_METADATA :
                navigator = new RowSetNavigatorClient(1);
                break;

            case ResultConstants.BATCHEXECRESPONSE :
                navigator = new RowSetNavigatorClient(4);
                break;

            case ResultConstants.DATA :
            case ResultConstants.DATAHEAD :
            case ResultConstants.DATAROWS :
View Full Code Here


                result.fetchSize       = in.readInt();
                result.rsScrollability = in.readShort();
                result.rsConcurrency   = in.readShort();
                result.rsHoldability   = in.readShort();
                result.metaData        = new ResultMetaData(in);
                result.navigator       = new RowSetNavigatorClient();

                result.navigator.read(in, result.metaData);

                break;
            }
            case ResultConstants.DATAROWS : {
                result.metaData  = new ResultMetaData(in);
                result.navigator = new RowSetNavigatorClient();

                result.navigator.read(in, result.metaData);

                break;
            }
View Full Code Here

    public static Result newSingleColumnResult(ResultMetaData meta) {

        Result result = newResult(ResultConstants.DATA);

        result.metaData  = meta;
        result.navigator = new RowSetNavigatorClient();

        return result;
    }
View Full Code Here

        result.metaData.columns[0].setType(type);
        result.metaData.prepareData();

        //
        result.navigator = new RowSetNavigatorClient(8);

        return result;
    }
View Full Code Here

    public static Result newDataResult(ResultMetaData md) {

        Result result = newResult(ResultConstants.DATA);

        result.navigator = new RowSetNavigatorClient();
        result.metaData  = md;

        return result;
    }
View Full Code Here

        }

        Result result = newResult(ResultConstants.DATAHEAD);

        result.metaData = source.metaData;
        result.navigator = new RowSetNavigatorClient(source.navigator, offset,
                count);

        result.navigator.setId(source.navigator.getId());
        result.setSession(session);
View Full Code Here

        Result result = newResult(ResultConstants.DATAROWS);

        result.id       = source.id;
        result.metaData = source.metaData;
        result.navigator = new RowSetNavigatorClient(source.navigator, offset,
                count);

        return result;
    }
View Full Code Here

     */
    public static Result newSessionAttributesResult() {

        Result result = newResult(ResultConstants.DATA);

        result.navigator = new RowSetNavigatorClient(1);
        result.metaData  = sessionAttributesMetaData;

        result.navigator.add(new Object[SessionInterface.INFO_LIMIT]);

        return result;
View Full Code Here

        }

        int count = 0;

        // 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();

        while (newData.hasNext()) {
            Object[] data = (Object[]) newData.getNext();

            baseTable.insertRow(session, store, data);

            if (generatedNavigator != null) {
                Object[] generatedValues = getGeneratedColumns(data);

                generatedNavigator.add(generatedValues);
            }
        }

        baseTable.fireAfterTriggers(session, Trigger.INSERT_AFTER, newData);

        count += newData.getSize();

        if (resultOut == null) {
            return Result.getUpdateCountResult(count);
        } else {
            resultOut.setUpdateCount(count);
View Full Code Here

        //
        Result                result = queryExpression.getResult(session, 0);
        RowSetNavigator       nav         = result.initialiseNavigator();
        Type[]                sourceTypes = result.metaData.columnTypes;
        RowSetNavigatorClient newData     = new RowSetNavigatorClient(2);

        while (nav.hasNext()) {
            Object[] data       = baseTable.getNewRowData(session);
            Object[] sourceData = (Object[]) nav.getNext();

            for (int i = 0; i < columnMap.length; i++) {
                int  j          = columnMap[i];
                Type sourceType = sourceTypes[i];

                data[j] = colTypes[j].convertToType(session, sourceData[i],
                                                    sourceType);
            }

            newData.add(data);
        }

        return newData;
    }
View Full Code Here

TOP

Related Classes of org.hsqldb.navigator.RowSetNavigatorClient

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.