Package org.hsqldb_voltpatches.persist

Examples of org.hsqldb_voltpatches.persist.PersistentStore


    public PersistentStore getNewResultRowStore(TableBase table,
            boolean isCached) {

        try {
            PersistentStore store = session.database.logger.newStore(session,
                    persistentStoreCollection, table, isCached);

            return store;
        } catch (HsqlException e) {}
View Full Code Here


     *  Return the list of file pointers to root nodes for this table's
     *  indexes.
     */
    public final int[] getIndexRootsArray() {

        PersistentStore store =
            database.persistentStoreCollection.getStore(this);
        int[] roots = new int[getIndexCount()];

        for (int i = 0; i < getIndexCount(); i++) {
            CachedObject accessor = store.getAccessor(indexList[i]);

            roots[i] = accessor == null ? -1
                                        : accessor.getPos();
        }

View Full Code Here

        if (!isCached) {
            throw Error.error(ErrorCode.X_42501, tableName.name);
        }

        PersistentStore store =
            database.persistentStoreCollection.getStore(this);

        for (int i = 0; i < getIndexCount(); i++) {
            store.setAccessor(indexList[i], roots[i]);
        }
    }
View Full Code Here

        if (adjust >= 0 && colindex != -1) {
            column   = getColumn(colindex);
            colvalue = column.getDefaultValue(session);
        }

        PersistentStore store = session.sessionData.getRowStore(this);

        try {
            RowIterator it = from.rowIterator(session);

            while (it.hasNext()) {
                Row      row  = it.getNextRow();
                Object[] o    = row.getData();
                Object[] data = getEmptyRowData();

                if (adjust == 0 && colindex != -1) {
                    colvalue = column.getDataType().convertToType(session,
                            o[colindex],
                            from.getColumn(colindex).getDataType());
                }

                ArrayUtil.copyAdjustArray(o, data, colvalue, colindex, adjust);
                systemSetIdentityColumn(session, data);
                enforceRowConstraints(session, data);

                // get object without RowAction
                Row newrow = (Row) store.getNewCachedObject(null, data);

                if (row.rowAction != null) {
                    newrow.rowAction =
                        row.rowAction.duplicate(newrow.getPos());
                }

                store.indexRow(null, newrow);
            }
        } catch (Throwable t) {
            store.release();

            if (t instanceof HsqlException) {
                throw (HsqlException) t;
            }
View Full Code Here

    /**
     * Multi-row insert method. Used for CREATE TABLE AS ... queries.
     */
    void insertIntoTable(Session session, Result result) {

        PersistentStore store = session.sessionData.getRowStore(this);
        RowSetNavigator nav   = result.initialiseNavigator();

        while (nav.hasNext()) {
            Object[] data = (Object[]) nav.getNext();
            Object[] newData =
View Full Code Here

     */
    public void insertNoCheckFromLog(Session session, Object[] data) {

        systemUpdateIdentityValue(data);

        PersistentStore store = session.sessionData.getRowStore(this);
        Row             row   = (Row) store.getNewCachedObject(session, data);

        store.indexRow(session, row);
        session.addInsertAction(this, row);
    }
View Full Code Here

     * For log statements. Delete a single row.
     */
    public void deleteNoCheckFromLog(Session session, Object[] data) {

        Row             row   = null;
        PersistentStore store = session.sessionData.getRowStore(this);

        if (hasPrimaryKey()) {
            RowIterator it = getPrimaryIndex().findFirstRow(session, store,
                data, primaryKeyColsSequence);

View Full Code Here

    void updateRowSet(Session session, HashMappedList rowSet, int[] cols,
                      boolean isTriggeredSet) {

        boolean         hasLob = false;
        PersistentStore store  = session.sessionData.getRowStore(this);

        for (int i = 0; i < rowSet.size(); i++) {
            Row row = (Row) rowSet.getKey(i);

            if (row.isDeleted(session)) {
View Full Code Here

        switch (actionType) {

            case ResultConstants.UPDATE_CURSOR : {
                Long id = (Long) args[args.length - 1];
                PersistentStore store =
                    session.sessionData.getRowStore(baseTable);
                Row row = (Row) store.get((int) id.longValue(), false);
                HashMappedList list = new HashMappedList();
                Object[] data =
                    (Object[]) ArrayUtil.duplicateArray(row.getData());

                for (int i = 0; i < baseColumnMap.length; i++) {
                    if (types[i] == Type.SQL_ALL_TYPES) {
                        continue;
                    }

                    data[baseColumnMap[i]] = args[i];
                }

                list.add(row, data);
                update(session, baseTable, list);

                break;
            }
            case ResultConstants.DELETE_CURSOR : {
                Long id = (Long) args[args.length - 1];
                PersistentStore store =
                    session.sessionData.getRowStore(baseTable);
                Row row = (Row) store.get((int) id.longValue(), false);
                RowSetNavigator navigator = new RowSetNavigatorLinkedList();

                navigator.add(row);
                delete(session, baseTable, navigator);

                break;
            }
            case ResultConstants.INSERT_CURSOR : {
                Object[] data = baseTable.getNewRowData(session);

                for (int i = 0; i < data.length; i++) {
                    data[baseColumnMap[i]] = args[i];
                }

                PersistentStore store =
                    session.sessionData.getRowStore(baseTable);

                baseTable.insertRow(session, store, data);
            }
        }
View Full Code Here

    /**
     * Fills the table with a result set
     */
    public void materialise(Session session) {

        PersistentStore store;

        // table constructors
        if (isDataExpression) {
            store = session.sessionData.getSubqueryRowStore(table);

View Full Code Here

TOP

Related Classes of org.hsqldb_voltpatches.persist.PersistentStore

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.