org.hsqldb.Row - java examples

Here are the examples of the java api org.hsqldb.Row taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

91 Examples 7

19 View Complete Implementation : RowStoreAVLDiskData.java
Copyright Apache License 2.0
Author : SERG-Delft
public CachedObject getNewCachedObject(Session session, Object object, boolean tx) {
    Row row = new RowAVLDiskData(this, table, (Object[]) object);
    add(session, row, tx);
    return row;
}

19 View Complete Implementation : RowStoreAVLHybrid.java
Copyright Apache License 2.0
Author : SERG-Delft
public CachedObject getNewCachedObject(Session session, Object object, boolean tx) {
    if (!isCached) {
        if (useDisk && elementCount.get() >= maxMemoryRowCount) {
            changeToDiskTable(session);
        }
    }
    Row row;
    if (isCached) {
        row = new RowAVLDisk(table, (Object[]) object, this);
    } else {
        int id = rowIdSequence++;
        row = new RowAVL(table, (Object[]) object, id, this);
    }
    add(session, row, tx);
    return row;
}

19 View Complete Implementation : RowSetNavigatorDataChangeMemory.java
Copyright Apache License 2.0
Author : SERG-Delft
public boolean containsDeletedRow(Row refRow) {
    int lookup = list.getLookup(refRow.getId());
    if (lookup == -1) {
        return false;
    }
    Object[] currentData = (Object[]) list.getSecondValueByIndex(lookup);
    return currentData == null;
}

19 View Complete Implementation : RowOutputBinaryEncode.java
Copyright Apache License 2.0
Author : SERG-Delft
/**
 *  Calculate the size of byte array required to store a row.
 *
 * @param  row - a database row
 * @return  size of byte array
 * @exception  HsqlException When data is inconsistent
 */
public int getSize(Row row) {
    int size = super.getSize(row);
    if (crypto != null) {
        size = crypto.getEncodedSize(size - INT_STORE_SIZE) + INT_STORE_SIZE * 2;
    }
    return size;
}

19 View Complete Implementation : RowStoreAVLHybridExtended.java
Copyright Apache License 2.0
Author : SERG-Delft
/**
 * Row might have changed from memory to disk or indexes added
 */
public void delete(Session session, Row row) {
    NodeAVL node = ((RowAVL) row).getNode(0);
    int count = 0;
    while (node != null) {
        count++;
        node = node.nNext;
    }
    if ((isCached ^ !row.isMemory()) || count != indexList.length) {
        row = ((Table) table).getDeleteRowFromLog(session, row.getData());
    }
    if (row != null) {
        super.delete(session, row);
    }
}

19 View Complete Implementation : RowStoreAVL.java
Copyright GNU General Public License v3.0
Author : apavlo
public final void indexRow(Session session, Row row) {
    int i = 0;
    try {
        for (; i < indexList.length; i++) {
            indexList[i].insert(session, this, row);
        }
    } catch (HsqlException e) {
        // unique index violation - rollback insert
        for (--i; i >= 0; i--) {
            indexList[i].delete(this, row);
        }
        remove(row.getPos());
        throw e;
    }
}

19 View Complete Implementation : RowStoreAVLDiskData.java
Copyright Apache License 2.0
Author : SERG-Delft
public void indexRow(Session session, Row row) {
    super.indexRow(session, row);
}

19 View Complete Implementation : RowStoreAVLDisk.java
Copyright GNU General Public License v3.0
Author : apavlo
public void set(CachedObject object) {
    Row row = ((Row) object);
    row.rowAction = (RowAction) rowActionMap.get(row.getPos());
}

19 View Complete Implementation : RowStoreAVLHybrid.java
Copyright Apache License 2.0
Author : SERG-Delft
public void rollbackRow(Session session, Row row, int changeAction, int txModel) {
    switch(changeAction) {
        case RowAction.ACTION_DELETE:
            row = (Row) get(row, true);
            ((RowAVL) row).setNewNodes(this);
            row.keepInMemory(false);
            indexRow(session, row);
            break;
        case RowAction.ACTION_INSERT:
            delete(session, row);
            remove(row);
            break;
        case RowAction.ACTION_INSERT_DELETE:
            // INSERT + DELEETE
            remove(row);
            break;
    }
}

19 View Complete Implementation : RowSetNavigatorDataTable.java
Copyright Apache License 2.0
Author : SERG-Delft
public void update(Object[] oldData, Object[] newData) {
    if (isSimpleAggregate) {
        return;
    }
    RowIterator it = groupIndex.findFirstRow((Session) session, store, oldData);
    if (it.hasNext()) {
        Row row = it.getNextRow();
        it.removeCurrent();
        it.release();
        size--;
        add(newData);
    }
}

19 View Complete Implementation : SimpleStore.java
Copyright Apache License 2.0
Author : SERG-Delft
public void delete(Session session, Row row) {
}

19 View Complete Implementation : RowStoreDataChange.java
Copyright Apache License 2.0
Author : SERG-Delft
public CachedObject getNewCachedObject(Session session, Object object, boolean tx) {
    Row row = new RowDiskDataChange(table, (Object[]) object, this, null);
    add(session, row, tx);
    return row;
}

19 View Complete Implementation : RowStoreAVLDisk.java
Copyright Apache License 2.0
Author : SERG-Delft
public CachedObject getNewCachedObject(Session session, Object object, boolean tx) {
    Row row;
    if (largeData) {
        row = new RowAVLDiskLarge(table, (Object[]) object, this);
    } else {
        row = new RowAVLDisk(table, (Object[]) object, this);
    }
    add(session, row, tx);
    return row;
}

19 View Complete Implementation : ScriptWriterText.java
Copyright Apache License 2.0
Author : SERG-Delft
public void writeInsertStatement(Session session, Row row, Table table) throws IOException {
    schemaToLog = table.getName().schema;
    writeRow(session, row, table);
}

19 View Complete Implementation : RowSetNavigatorData.java
Copyright GNU General Public License v3.0
Author : apavlo
public void add(Object data) {
    try {
        Row row = (Row) store.getNewCachedObject(session, data);
        store.indexRow(null, row);
        size++;
    } catch (HsqlException e) {
    }
}

19 View Complete Implementation : RowStoreAVLDiskData.java
Copyright Apache License 2.0
Author : SERG-Delft
public void commitRow(Session session, Row row, int changeAction, int txModel) {
    switch(changeAction) {
        case RowAction.ACTION_DELETE:
            cache.removePersistence(row);
            break;
        case RowAction.ACTION_INSERT:
            commitPersistence(row);
            break;
        case RowAction.ACTION_INSERT_DELETE:
            // INSERT + DELETE
            if (txModel == TransactionManager.LOCKS) {
                remove(row);
            } else {
                delete(session, row);
                remove(row);
            }
            break;
        case RowAction.ACTION_DELETE_FINAL:
            throw Error.runtimeError(ErrorCode.U_S0500, "RowStore");
    }
}

19 View Complete Implementation : RowSetNavigatorData.java
Copyright Apache License 2.0
Author : SERG-Delft
public boolean addRow(Row row) {
    throw Error.runtimeError(ErrorCode.U_S0500, "RowSetNavigatorData");
}

19 View Complete Implementation : RowStoreAVLHybrid.java
Copyright Apache License 2.0
Author : SERG-Delft
public void commitRow(Session session, Row row, int changeAction, int txModel) {
    switch(changeAction) {
        case RowAction.ACTION_DELETE:
            remove(row);
            break;
        case RowAction.ACTION_INSERT:
            break;
        case RowAction.ACTION_INSERT_DELETE:
            // INSERT + DELEETE
            remove(row);
            break;
        case RowAction.ACTION_DELETE_FINAL:
            throw Error.runtimeError(ErrorCode.U_S0500, "RowStore");
    }
}

19 View Complete Implementation : RowStoreAVLDiskData.java
Copyright GNU General Public License v3.0
Author : apavlo
public CachedObject getNewCachedObject(Session session, Object object) {
    Row row = new RowAVLDiskData(table, (Object[]) object);
    add(row);
    RowAction.addAction(session, RowAction.ACTION_INSERT, table, row);
    return row;
}

19 View Complete Implementation : RowStoreAVLHybrid.java
Copyright Apache License 2.0
Author : SERG-Delft
public void indexRow(Session session, Row row) {
    try {
        row = (Row) get(row, true);
        super.indexRow(session, row);
    } catch (HsqlException e) {
        throw e;
    } finally {
        row.keepInMemory(false);
    }
}

19 View Complete Implementation : RowSetNavigatorDataTable.java
Copyright Apache License 2.0
Author : SERG-Delft
public void add(Object[] data) {
    try {
        Row row = (Row) store.getNewCachedObject((Session) session, data, false);
        store.indexRow((Session) session, row);
        size++;
    } catch (HsqlException e) {
    }
}

19 View Complete Implementation : RowStoreAVLHybridExtended.java
Copyright Apache License 2.0
Author : SERG-Delft
public void indexRow(Session session, Row row) {
    NodeAVL node = ((RowAVL) row).getNode(0);
    int count = 0;
    while (node != null) {
        count++;
        node = node.nNext;
    }
    if ((isCached ^ !row.isMemory()) || count != indexList.length) {
        row = (Row) getNewCachedObject(session, row.getData(), true);
    }
    super.indexRow(session, row);
}

19 View Complete Implementation : NodeAVLMemory.java
Copyright GNU General Public License v3.0
Author : apavlo
// fredt@users 20020221 - patch 513005 by sqlbob@users (RMP)
/**
 *  Memory table node implementation.
 *
 *  New clreplaced derived from Hypersonic SQL code and enhanced in HSQLDB. <p>
 *
 * @author Thomas Mueller (Hypersonic SQL Group)
 * @version 1.9.0
 * @since 1.7.1
 */
public clreplaced NodeAVLMemory extends NodeAVLBaseMemory {

    protected Row rData;

    /**
     * A MemoreyNode is permenently linked with the row it refers to.
     *
     * @param r Row
     */
    public NodeAVLMemory(Row r) {
        rData = r;
    }

    public int getPos() {
        return 0;
    }

    Row getRow(PersistentStore store) {
        return rData;
    }
}

19 View Complete Implementation : RowStoreAVLMemory.java
Copyright Apache License 2.0
Author : SERG-Delft
public void rollbackRow(Session session, Row row, int changeAction, int txModel) {
    switch(changeAction) {
        case RowAction.ACTION_DELETE:
            if (txModel == TransactionManager.LOCKS) {
                ((RowAVL) row).setNewNodes(this);
                indexRow(session, row);
            }
            break;
        case RowAction.ACTION_INSERT:
            delete(session, row);
            remove(row);
            break;
        case RowAction.ACTION_INSERT_DELETE:
            // INSERT + DELETE
            remove(row);
            break;
    }
}

19 View Complete Implementation : RowSetNavigatorDataTable.java
Copyright Apache License 2.0
Author : SERG-Delft
public void intersectAll(Session session, RowSetNavigatorData other) {
    Object[] compareData = null;
    RowIterator it;
    Row otherRow = null;
    Object[] otherData = null;
    sortFull(session);
    other.sortFull(session);
    it = fullIndex.emptyIterator();
    while (hasNext()) {
        Object[] currentData = getNext();
        boolean newGroup = compareData == null || fullIndex.compareRowNonUnique(session, currentData, compareData, fullIndex.getColumnCount()) != 0;
        if (newGroup) {
            compareData = currentData;
            it = other.findFirstRow(currentData);
        }
        otherRow = it.getNextRow();
        otherData = otherRow == null ? null : otherRow.getData();
        if (otherData != null && fullIndex.compareRowNonUnique(session, currentData, otherData, fullIndex.getColumnCount()) == 0) {
            continue;
        }
        removeCurrent();
    }
    other.release();
}

19 View Complete Implementation : SimpleStore.java
Copyright Apache License 2.0
Author : SERG-Delft
public void commitRow(Session session, Row row, int changeAction, int txModel) {
}

19 View Complete Implementation : SimpleStore.java
Copyright Apache License 2.0
Author : SERG-Delft
public void rollbackRow(Session session, Row row, int changeAction, int txModel) {
}

19 View Complete Implementation : RowStoreAVLDisk.java
Copyright Apache License 2.0
Author : SERG-Delft
public void delete(Session session, Row row) {
    writeLock();
    try {
        super.delete(session, row);
    } finally {
        writeUnlock();
    }
}

19 View Complete Implementation : RowOutputBase.java
Copyright Apache License 2.0
Author : SERG-Delft
/**
 *  This method is called to write data for a table row.
 */
public void writeData(Row row, Type[] types) {
    writeData(types.length, types, row.getData(), null, null);
}

19 View Complete Implementation : NodeAVL.java
Copyright Apache License 2.0
Author : SERG-Delft
// fredt@users 20020221 - patch 513005 by sqlbob@users (RMP)
// fredt@users 20020920 - path 1.7.1 - refactoring to cut memory footprint
// fredt@users 20021205 - path 1.7.2 - enhancements
// fredt@users 20021215 - doc 1.7.2 - javadoc comments
/**
 *  The parent for all AVL node implementations. Subclreplacedes of Node vary
 *  in the way they hold
 *  references to other Nodes in the AVL tree, or to their Row data.<br>
 *
 *  nNext links the Node objects belonging to different indexes for each
 *  table row. It is used solely by Row to locate the node belonging to a
 *  particular index.<br>
 *
 *  New clreplaced derived from Hypersonic SQL code and enhanced in HSQLDB. <p>
 *
 * @author Fred Toussi (fredt@users dot sourceforge dot net)
 * @author Thomas Mueller (Hypersonic SQL Group)
 * @version 2.3.3
 * @since Hypersonic SQL
 */
public clreplaced NodeAVL implements CachedObject {

    static final int NO_POS = RowAVLDisk.NO_POS;

    public int iBalance;

    // node of next index (nNext==null || nNext.iId=iId+1)
    public NodeAVL nNext;

    // 
    protected NodeAVL nLeft;

    protected NodeAVL nRight;

    protected NodeAVL nParent;

    protected final Row row;

    NodeAVL() {
        row = null;
    }

    public NodeAVL(Row r) {
        row = r;
    }

    public void delete() {
        iBalance = 0;
        nLeft = nRight = nParent = null;
    }

    NodeAVL getLeft(PersistentStore store) {
        return nLeft;
    }

    NodeAVL setLeft(PersistentStore persistentStore, NodeAVL n) {
        nLeft = n;
        return this;
    }

    public int getBalance(PersistentStore store) {
        return iBalance;
    }

    boolean isLeft(NodeAVL node) {
        return nLeft == node;
    }

    boolean isRight(NodeAVL node) {
        return nRight == node;
    }

    NodeAVL getRight(PersistentStore persistentStore) {
        return nRight;
    }

    NodeAVL setRight(PersistentStore persistentStore, NodeAVL n) {
        nRight = n;
        return this;
    }

    NodeAVL getParent(PersistentStore store) {
        return nParent;
    }

    boolean isRoot(PersistentStore store) {
        return nParent == null;
    }

    NodeAVL setParent(PersistentStore persistentStore, NodeAVL n) {
        nParent = n;
        return this;
    }

    public NodeAVL setBalance(PersistentStore store, int b) {
        iBalance = b;
        return this;
    }

    boolean isFromLeft(PersistentStore store) {
        if (nParent == null) {
            return true;
        }
        return this == nParent.nLeft;
    }

    public NodeAVL child(PersistentStore store, boolean isleft) {
        return isleft ? getLeft(store) : getRight(store);
    }

    public NodeAVL set(PersistentStore store, boolean isLeft, NodeAVL n) {
        if (isLeft) {
            nLeft = n;
        } else {
            nRight = n;
        }
        if (n != null) {
            n.nParent = this;
        }
        return this;
    }

    public void replace(PersistentStore store, Index index, NodeAVL n) {
        if (nParent == null) {
            if (n != null) {
                n = n.setParent(store, null);
            }
            store.setAccessor(index, n);
        } else {
            nParent.set(store, isFromLeft(store), n);
        }
    }

    boolean equals(NodeAVL n) {
        return n == this;
    }

    public void setInMemory(boolean in) {
    }

    public int getDefaultCapacity() {
        return 0;
    }

    public void read(RowInputInterface in) {
    }

    public void write(RowOutputInterface out) {
    }

    public void write(RowOutputInterface out, LongLookup lookup) {
    }

    public long getPos() {
        return 0;
    }

    public RowAVL getRow(PersistentStore store) {
        return (RowAVL) row;
    }

    protected Object[] getData(PersistentStore store) {
        return row.getData();
    }

    public void updateAccessCount(int count) {
    }

    public int getAccessCount() {
        return 0;
    }

    public void setStorageSize(int size) {
    }

    public int getStorageSize() {
        return 0;
    }

    final public boolean isInvariable() {
        return false;
    }

    final public boolean isBlock() {
        return false;
    }

    public void setPos(long pos) {
    }

    public boolean isNew() {
        return false;
    }

    public boolean hasChanged() {
        return false;
    }

    public void setChanged(boolean flag) {
    }

    public boolean isKeepInMemory() {
        return false;
    }

    public boolean keepInMemory(boolean keep) {
        return true;
    }

    public boolean isInMemory() {
        return false;
    }

    public void restore() {
    }

    public void destroy() {
    }

    public int getRealSize(RowOutputInterface out) {
        return 0;
    }

    public boolean isMemory() {
        return true;
    }
}

19 View Complete Implementation : RowOutputBinaryEncode.java
Copyright Apache License 2.0
Author : SERG-Delft
public void writeData(Row row, Type[] types) {
    if (crypto == null) {
        super.writeData(row, types);
    } else {
        int start = count;
        ensureRoom(row.getStorageSize());
        writeInt(0);
        super.writeData(row, types);
        int origLength = count - start - INT_STORE_SIZE;
        int newLength = crypto.encode(buffer, start + INT_STORE_SIZE, origLength, buffer, start + INT_STORE_SIZE);
        writeIntData(newLength, start);
        count = start + INT_STORE_SIZE + newLength;
    }
}

19 View Complete Implementation : RowStoreAVLDiskData.java
Copyright Apache License 2.0
Author : SERG-Delft
public void rollbackRow(Session session, Row row, int changeAction, int txModel) {
    switch(changeAction) {
        case RowAction.ACTION_DELETE:
            if (txModel == TransactionManager.LOCKS) {
                ((RowAVL) row).setNewNodes(this);
                indexRow(session, row);
            }
            break;
        case RowAction.ACTION_INSERT:
            if (txModel == TransactionManager.LOCKS) {
                delete(session, row);
                remove(row);
            }
            break;
        case RowAction.ACTION_INSERT_DELETE:
            // INSERT + DELETE
            if (txModel == TransactionManager.LOCKS) {
                remove(row);
            } else {
                delete(session, row);
                remove(row);
            }
            break;
    }
}

19 View Complete Implementation : RowSetNavigatorClient.java
Copyright Apache License 2.0
Author : SERG-Delft
public boolean addRow(Row row) {
    throw Error.runtimeError(ErrorCode.U_S0500, "RowSetNavigatorClient");
}

19 View Complete Implementation : RowStoreAVL.java
Copyright GNU General Public License v3.0
Author : apavlo
/**
 * Basic delete with no logging or referential checks.
 */
public final void delete(Row row) {
    for (int i = indexList.length - 1; i >= 0; i--) {
        indexList[i].delete(this, row);
    }
    remove(row.getPos());
}

19 View Complete Implementation : RowOutputTextLog.java
Copyright GNU General Public License v3.0
Author : apavlo
public int getSize(Row row) {
    return 0;
}

19 View Complete Implementation : RowSetNavigatorDataTable.java
Copyright Apache License 2.0
Author : SERG-Delft
public void exceptAll(Session session, RowSetNavigatorData other) {
    Object[] compareData = null;
    RowIterator it;
    Row otherRow = null;
    Object[] otherData = null;
    sortFull(session);
    other.sortFull(session);
    it = fullIndex.emptyIterator();
    while (hasNext()) {
        Object[] currentData = getNext();
        boolean newGroup = compareData == null || fullIndex.compareRowNonUnique(session, currentData, compareData, fullIndex.getColumnCount()) != 0;
        if (newGroup) {
            compareData = currentData;
            it = other.findFirstRow(currentData);
        }
        otherRow = it.getNextRow();
        otherData = otherRow == null ? null : otherRow.getData();
        if (otherData != null && fullIndex.compareRowNonUnique(session, currentData, otherData, fullIndex.getColumnCount()) == 0) {
            removeCurrent();
        }
    }
    other.release();
}

19 View Complete Implementation : SimpleStore.java
Copyright Apache License 2.0
Author : SERG-Delft
public void indexRow(Session session, Row row) {
}

18 View Complete Implementation : IndexAVL.java
Copyright GNU General Public License v3.0
Author : apavlo
public void delete(PersistentStore store, Row row) {
    if (!row.isInMemory()) {
        row = (Row) store.get(row, false);
    }
    NodeAVL node = ((RowAVL) row).getNode(position);
    delete(store, node);
}

18 View Complete Implementation : IndexAVL.java
Copyright GNU General Public License v3.0
Author : apavlo
/**
 * Compare two rows of the table for inserting rows into unique indexes
 * Supports descending columns.
 *
 * @param newRow data
 * @param existingRow data
 * @return comparison result, -1,0,+1
 */
private int compareRowForInsertOrDelete(Session session, Row newRow, Row existingRow) {
    Object[] a = newRow.getData();
    Object[] b = existingRow.getData();
    int j = 0;
    boolean hasNull = false;
    for (; j < colIndex.length; j++) {
        Object currentvalue = a[colIndex[j]];
        Object othervalue = b[colIndex[j]];
        int i = colTypes[j].compare(currentvalue, othervalue);
        boolean nulls = currentvalue == null || othervalue == null;
        if (i != 0) {
            if (colDesc[j] && !nulls) {
                i = -i;
            }
            if (nullsLast[j] && nulls) {
                i = -i;
            }
            return i;
        }
        if (currentvalue == null) {
            hasNull = true;
        }
    }
    if (isUnique && !useRowId && !hasNull) {
        if (session == null || session.database.txManager.canRead(session, existingRow)) {
            // * debug 190
            // session.database.txManager.canRead(session, existingRow);
            return 0;
        } else {
            int difference = newRow.getPos() - existingRow.getPos();
            return difference;
        }
    }
    for (j = 0; j < pkCols.length; j++) {
        Object currentvalue = a[pkCols[j]];
        int i = pkTypes[j].compare(currentvalue, b[pkCols[j]]);
        if (i != 0) {
            return i;
        }
    }
    if (useRowId) {
        int difference = newRow.getPos() - existingRow.getPos();
        if (difference < 0) {
            difference = -1;
        } else if (difference > 0) {
            difference = 1;
        }
        return difference;
    }
    if (session == null || session.database.txManager.canRead(session, existingRow)) {
        return 0;
    } else {
        int difference = newRow.getPos() - existingRow.getPos();
        if (difference < 0) {
            difference = -1;
        } else if (difference > 0) {
            difference = 1;
        }
        return difference;
    }
}

18 View Complete Implementation : RowSetNavigatorData.java
Copyright GNU General Public License v3.0
Author : apavlo
public void intersectAll(RowSetNavigatorData other) {
    Object[] compareData = null;
    RowIterator it;
    Row otherRow = null;
    Object[] otherData = null;
    sortFull();
    reset();
    other.sortFull();
    it = other.fullIndex.emptyIterator();
    while (hasNext()) {
        getNext();
        Object[] currentData = currentRow.getData();
        boolean newGroup = compareData == null || fullIndex.compareRowNonUnique(currentData, compareData, fullIndex.getColumnCount()) != 0;
        if (newGroup) {
            compareData = currentData;
            it = other.fullIndex.findFirstRow(session, other.store, currentData);
        }
        otherRow = it.getNextRow();
        otherData = otherRow == null ? null : otherRow.getData();
        if (otherData != null && fullIndex.compareRowNonUnique(currentData, otherData, fullIndex.getColumnCount()) == 0) {
            continue;
        }
        remove();
    }
    other.close();
}

18 View Complete Implementation : RowSetNavigatorData.java
Copyright GNU General Public License v3.0
Author : apavlo
private void addAdjusted(Object[] data, int[] columnMap) {
    try {
        if (columnMap == null) {
            data = (Object[]) ArrayUtil.resizeArrayIfDifferent(data, table.getColumnCount());
        } else {
            Object[] newData = new Object[table.getColumnCount()];
            ArrayUtil.projectRow(data, columnMap, newData);
            data = newData;
        }
        Row row = (Row) store.getNewCachedObject(session, data);
        store.indexRow(null, row);
        size++;
    } catch (HsqlException e) {
    }
}

18 View Complete Implementation : RowSetNavigatorData.java
Copyright GNU General Public License v3.0
Author : apavlo
public void exceptAll(RowSetNavigatorData other) {
    Object[] compareData = null;
    RowIterator it;
    Row otherRow = null;
    Object[] otherData = null;
    sortFull();
    reset();
    other.sortFull();
    it = other.fullIndex.emptyIterator();
    while (hasNext()) {
        getNext();
        Object[] currentData = currentRow.getData();
        boolean newGroup = compareData == null || fullIndex.compareRowNonUnique(currentData, compareData, fullIndex.getColumnCount()) != 0;
        if (newGroup) {
            compareData = currentData;
            it = other.fullIndex.findFirstRow(session, other.store, currentData);
        }
        otherRow = it.getNextRow();
        otherData = otherRow == null ? null : otherRow.getData();
        if (otherData != null && fullIndex.compareRowNonUnique(currentData, otherData, fullIndex.getColumnCount()) == 0) {
            remove();
        }
    }
    other.close();
}

18 View Complete Implementation : RowSetNavigatorData.java
Copyright GNU General Public License v3.0
Author : apavlo
/**
 * Implementation or RowSetNavigator using a table as the data store.
 *
 * @author Fred Toussi (fredt@users dot sourceforge.net)
 * @version 1.9.0
 * @since 1.9.0
 */
public clreplaced RowSetNavigatorData extends RowSetNavigator {

    final Session session;

    public TableBase table;

    public PersistentStore store;

    RowIterator iterator;

    Row currentRow;

    int maxMemoryRowCount;

    boolean isClosed;

    int visibleColumnCount;

    boolean isAggregate;

    boolean isSimpleAggregate;

    Object[] simpleAggregateData;

    // 
    boolean reindexTable;

    // 
    private Index mainIndex;

    private Index fullIndex;

    private Index orderIndex;

    private Index groupIndex;

    public RowSetNavigatorData(Session session, QuerySpecification select) {
        this.session = session;
        maxMemoryRowCount = session.getResultMemoryRowCount();
        visibleColumnCount = select.indexLimitVisible;
        table = select.resultTable.duplicate();
        table.store = store = session.sessionData.getNewResultRowStore(table, !select.isAggregated);
        isAggregate = select.isAggregated;
        isSimpleAggregate = select.isAggregated && !select.isGrouped;
        reindexTable = select.isGrouped;
        mainIndex = select.mainIndex;
        fullIndex = select.fullIndex;
        orderIndex = select.orderIndex;
        groupIndex = select.groupIndex;
    }

    public RowSetNavigatorData(Session session, QueryExpression queryExpression) {
        this.session = session;
        maxMemoryRowCount = session.getResultMemoryRowCount();
        table = queryExpression.resultTable.duplicate();
        visibleColumnCount = table.getColumnCount();
        table.store = store = session.sessionData.getNewResultRowStore(table, true);
        mainIndex = queryExpression.mainIndex;
        fullIndex = queryExpression.fullIndex;
    }

    public RowSetNavigatorData(Session session, TableBase table) {
        this.session = session;
        maxMemoryRowCount = session.getResultMemoryRowCount();
        this.table = table;
        visibleColumnCount = table.getColumnCount();
        store = session.sessionData.getRowStore(table);
        mainIndex = table.getPrimaryIndex();
        fullIndex = table.getFullIndex();
        this.size = mainIndex.size(store);
    }

    public void sortFull() {
        if (reindexTable) {
            store.indexRows();
        }
        mainIndex = fullIndex;
        reset();
    }

    public void sortOrder() {
        if (orderIndex != null) {
            if (reindexTable) {
                store.indexRows();
            }
            mainIndex = orderIndex;
            reset();
        }
    }

    public void sortUnion(SortAndSlice sortAndSlice) {
        if (sortAndSlice.index != null) {
            mainIndex = sortAndSlice.index;
            reset();
        }
    }

    public void sortGroup() {
        mainIndex = groupIndex;
        reset();
    }

    public void add(Object data) {
        try {
            Row row = (Row) store.getNewCachedObject(session, data);
            store.indexRow(null, row);
            size++;
        } catch (HsqlException e) {
        }
    }

    private void addAdjusted(Object[] data, int[] columnMap) {
        try {
            if (columnMap == null) {
                data = (Object[]) ArrayUtil.resizeArrayIfDifferent(data, table.getColumnCount());
            } else {
                Object[] newData = new Object[table.getColumnCount()];
                ArrayUtil.projectRow(data, columnMap, newData);
                data = newData;
            }
            Row row = (Row) store.getNewCachedObject(session, data);
            store.indexRow(null, row);
            size++;
        } catch (HsqlException e) {
        }
    }

    public void clear() {
        table.clearAllData(store);
        size = 0;
        reset();
    }

    public Object[] getCurrent() {
        return currentRow.getData();
    }

    public Row getCurrentRow() {
        return currentRow;
    }

    public boolean next() {
        boolean result = super.next();
        currentRow = iterator.getNextRow();
        return result;
    }

    public void remove() {
        if (currentRow != null) {
            iterator.remove();
            currentRow = null;
            currentPos--;
            size--;
        }
    }

    public void reset() {
        super.reset();
        iterator = mainIndex.firstRow(store);
    }

    public void close() {
        if (isClosed) {
            return;
        }
        iterator.release();
        store.release();
        isClosed = true;
    }

    public boolean isMemory() {
        return store.isMemory();
    }

    public void read(RowInputInterface in, ResultMetaData meta) throws IOException {
    }

    public void write(RowOutputInterface out, ResultMetaData meta) throws IOException {
        reset();
        out.writeLong(id);
        out.writeInt(size);
        // offset
        out.writeInt(0);
        out.writeInt(size);
        while (hasNext()) {
            Object[] data = (Object[]) getNext();
            out.writeData(meta.getExtendedColumnCount(), meta.columnTypes, data, null, null);
        }
        reset();
    }

    public void copy(RowSetNavigatorData other, int[] rightColumnIndexes) {
        while (other.hasNext()) {
            other.getNext();
            Object[] currentData = other.currentRow.getData();
            addAdjusted(currentData, rightColumnIndexes);
        }
        other.close();
    }

    public void union(RowSetNavigatorData other, int[] rightColumnIndexes) {
        Object[] currentData;
        removeDuplicates();
        reset();
        while (other.hasNext()) {
            other.getNext();
            currentData = other.currentRow.getData();
            RowIterator it = fullIndex.findFirstRow(session, store, currentData, rightColumnIndexes);
            if (!it.hasNext()) {
                addAdjusted(currentData, rightColumnIndexes);
            }
        }
        other.close();
    }

    public void unionAll(RowSetNavigatorData other, int[] rightColumnIndexes) {
        other.reset();
        while (other.hasNext()) {
            other.getNext();
            Object[] currentData = other.currentRow.getData();
            addAdjusted(currentData, rightColumnIndexes);
        }
        other.close();
    }

    public void intersect(RowSetNavigatorData other) {
        removeDuplicates();
        reset();
        other.sortFull();
        while (hasNext()) {
            getNext();
            Object[] currentData = currentRow.getData();
            RowIterator it = other.fullIndex.findFirstRow(session, other.store, currentData);
            if (!it.hasNext()) {
                remove();
            }
        }
        other.close();
    }

    public void intersectAll(RowSetNavigatorData other) {
        Object[] compareData = null;
        RowIterator it;
        Row otherRow = null;
        Object[] otherData = null;
        sortFull();
        reset();
        other.sortFull();
        it = other.fullIndex.emptyIterator();
        while (hasNext()) {
            getNext();
            Object[] currentData = currentRow.getData();
            boolean newGroup = compareData == null || fullIndex.compareRowNonUnique(currentData, compareData, fullIndex.getColumnCount()) != 0;
            if (newGroup) {
                compareData = currentData;
                it = other.fullIndex.findFirstRow(session, other.store, currentData);
            }
            otherRow = it.getNextRow();
            otherData = otherRow == null ? null : otherRow.getData();
            if (otherData != null && fullIndex.compareRowNonUnique(currentData, otherData, fullIndex.getColumnCount()) == 0) {
                continue;
            }
            remove();
        }
        other.close();
    }

    public void except(RowSetNavigatorData other) {
        removeDuplicates();
        reset();
        other.sortFull();
        while (hasNext()) {
            getNext();
            Object[] currentData = currentRow.getData();
            RowIterator it = other.fullIndex.findFirstRow(session, other.store, currentData);
            if (it.hasNext()) {
                remove();
            }
        }
        other.close();
    }

    public void exceptAll(RowSetNavigatorData other) {
        Object[] compareData = null;
        RowIterator it;
        Row otherRow = null;
        Object[] otherData = null;
        sortFull();
        reset();
        other.sortFull();
        it = other.fullIndex.emptyIterator();
        while (hasNext()) {
            getNext();
            Object[] currentData = currentRow.getData();
            boolean newGroup = compareData == null || fullIndex.compareRowNonUnique(currentData, compareData, fullIndex.getColumnCount()) != 0;
            if (newGroup) {
                compareData = currentData;
                it = other.fullIndex.findFirstRow(session, other.store, currentData);
            }
            otherRow = it.getNextRow();
            otherData = otherRow == null ? null : otherRow.getData();
            if (otherData != null && fullIndex.compareRowNonUnique(currentData, otherData, fullIndex.getColumnCount()) == 0) {
                remove();
            }
        }
        other.close();
    }

    public boolean hasUniqueNotNullRows() {
        sortFull();
        reset();
        Object[] lastRowData = null;
        while (hasNext()) {
            getNext();
            Object[] currentData = currentRow.getData();
            if (hasNull(currentData)) {
                continue;
            }
            if (lastRowData != null && equals(lastRowData, currentData)) {
                return false;
            } else {
                lastRowData = currentData;
            }
        }
        return true;
    }

    public void removeDuplicates() {
        sortFull();
        reset();
        Object[] lastRowData = null;
        while (hasNext()) {
            getNext();
            Object[] currentData = currentRow.getData();
            if (lastRowData != null && equals(lastRowData, currentData)) {
                remove();
            } else {
                lastRowData = currentData;
            }
        }
    }

    public void trim(int limitstart, int limitcount) {
        if (size == 0) {
            return;
        }
        if (limitstart >= size) {
            clear();
            return;
        }
        if (limitstart != 0) {
            reset();
            for (int i = 0; i < limitstart; i++) {
                next();
                remove();
            }
        }
        if (limitcount == 0 || limitcount >= size) {
            return;
        }
        reset();
        for (int i = 0; i < limitcount; i++) {
            next();
        }
        while (hasNext()) {
            next();
            remove();
        }
    }

    private boolean hasNull(Object[] data) {
        for (int i = 0; i < visibleColumnCount; i++) {
            if (data[i] == null) {
                return true;
            }
        }
        return false;
    }

    private boolean equals(Object[] data1, Object[] data2) {
        Type[] types = table.getColumnTypes();
        for (int i = 0; i < visibleColumnCount; i++) {
            if (types[i].compare(data1[i], data2[i]) != 0) {
                return false;
            }
        }
        return true;
    }

    /**
     * Special case for isSimpleAggregate cannot use index lookup.
     */
    public Object[] getGroupData(Object[] data) {
        if (isSimpleAggregate) {
            if (simpleAggregateData == null) {
                simpleAggregateData = data;
                return null;
            }
            return simpleAggregateData;
        }
        RowIterator it = groupIndex.findFirstRow(session, store, data);
        if (it.hasNext()) {
            Row row = it.getNextRow();
            if (isAggregate) {
                row.setChanged();
            }
            return row.getData();
        }
        return null;
    }
}

18 View Complete Implementation : RowStoreAVL.java
Copyright GNU General Public License v3.0
Author : apavlo
public final void indexRows() {
    RowIterator it = rowIterator();
    for (int i = 1; i < indexList.length; i++) {
        setAccessor(indexList[i], null);
    }
    while (it.hasNext()) {
        Row row = it.getNextRow();
        if (row instanceof RowAVL) {
            ((RowAVL) row).clearNonPrimaryNodes();
        }
        for (int i = 1; i < indexList.length; i++) {
            indexList[i].insert(null, this, row);
        }
    }
}

18 View Complete Implementation : RowSetNavigatorDataChangeMemory.java
Copyright Apache License 2.0
Author : SERG-Delft
public Object[] getNext() {
    if (next()) {
        Row row = getCurrentRow();
        return row.getData();
    }
    return null;
}

18 View Complete Implementation : RowSetNavigatorDataTable.java
Copyright Apache License 2.0
Author : SERG-Delft
/**
 * Special case for isSimpleAggregate cannot use index lookup.
 */
public Object[] getGroupData(Object[] data) {
    if (isSimpleAggregate) {
        if (simpleAggregateData == null) {
            simpleAggregateData = data;
            return null;
        }
        return simpleAggregateData;
    }
    RowIterator it = groupIndex.findFirstRow((Session) session, store, data);
    if (it.hasNext()) {
        Row row = it.getNextRow();
        if (isAggregate) {
            row.setChanged(true);
        }
        return row.getData();
    }
    return null;
}

18 View Complete Implementation : RowSetNavigatorDataTable.java
Copyright Apache License 2.0
Author : SERG-Delft
/**
 * Implementation of RowSetNavigator using a table as the data store.
 *
 * @author Fred Toussi (fredt@users dot sourceforge.net)
 * @version 2.3.3
 * @since 1.9.0
 */
public clreplaced RowSetNavigatorDataTable extends RowSetNavigatorData {

    public TableBase table;

    public PersistentStore store;

    RowIterator iterator;

    Row currentRow;

    int maxMemoryRowCount;

    Object[] tempRowData;

    public RowSetNavigatorDataTable(Session session, QuerySpecification select) {
        super(session);
        this.rangePosition = select.resultRangePosition;
        maxMemoryRowCount = session.getResultMemoryRowCount();
        visibleColumnCount = select.indexLimitVisible;
        table = select.resultTable.duplicate();
        store = session.sessionData.getNewResultRowStore(table, !select.isAggregated);
        table.store = store;
        isAggregate = select.isAggregated;
        isSimpleAggregate = select.isAggregated && !select.isGrouped;
        reindexTable = select.isGrouped;
        mainIndex = select.mainIndex;
        fullIndex = select.fullIndex;
        orderIndex = select.orderIndex;
        groupIndex = select.groupIndex;
        idIndex = select.idIndex;
        tempRowData = new Object[1];
    }

    public RowSetNavigatorDataTable(Session session, QuerySpecification select, RowSetNavigatorData navigator) {
        this(session, select);
        navigator.reset();
        while (navigator.hasNext()) {
            add(navigator.getNext());
        }
    }

    public RowSetNavigatorDataTable(Session session, QueryExpression queryExpression) {
        super(session);
        maxMemoryRowCount = session.getResultMemoryRowCount();
        table = queryExpression.resultTable.duplicate();
        visibleColumnCount = table.getColumnCount();
        store = session.sessionData.getNewResultRowStore(table, true);
        table.store = store;
        mainIndex = queryExpression.mainIndex;
        fullIndex = queryExpression.fullIndex;
    }

    public RowSetNavigatorDataTable(Session session, Table table) {
        super(session);
        maxMemoryRowCount = session.getResultMemoryRowCount();
        this.table = table;
        visibleColumnCount = table.getColumnCount();
        mainIndex = table.getPrimaryIndex();
        fullIndex = table.getFullIndex(session);
        store = table.getRowStore(session);
        this.size = (int) mainIndex.size(session, store);
        reset();
    }

    public void sortFull(Session session) {
        if (reindexTable) {
            store.indexRows(session);
        }
        mainIndex = fullIndex;
        reset();
    }

    public void sortOrder(Session session) {
        if (orderIndex != null) {
            if (reindexTable) {
                store.indexRows(session);
            }
            mainIndex = orderIndex;
            if (iterator != null) {
                iterator.release();
            }
            reset();
        }
    }

    public void sortOrderUnion(Session session, SortAndSlice sortAndSlice) {
        if (sortAndSlice.index != null) {
            mainIndex = sortAndSlice.index;
            reset();
        }
    }

    public void add(Object[] data) {
        try {
            Row row = (Row) store.getNewCachedObject((Session) session, data, false);
            store.indexRow((Session) session, row);
            size++;
        } catch (HsqlException e) {
        }
    }

    void addAdjusted(Object[] data, int[] columnMap) {
        try {
            if (columnMap == null) {
                data = (Object[]) ArrayUtil.resizeArrayIfDifferent(data, visibleColumnCount);
            } else {
                Object[] newData = new Object[visibleColumnCount];
                ArrayUtil.projectRow(data, columnMap, newData);
                data = newData;
            }
            add(data);
        } catch (HsqlException e) {
        }
    }

    public void update(Object[] oldData, Object[] newData) {
        if (isSimpleAggregate) {
            return;
        }
        RowIterator it = groupIndex.findFirstRow((Session) session, store, oldData);
        if (it.hasNext()) {
            Row row = it.getNextRow();
            it.removeCurrent();
            it.release();
            size--;
            add(newData);
        }
    }

    public boolean absolute(int position) {
        return super.absolute(position);
    }

    public Object[] getCurrent() {
        return currentRow.getData();
    }

    public Row getCurrentRow() {
        return currentRow;
    }

    public boolean next() {
        boolean result = super.next();
        currentRow = iterator.getNextRow();
        return result;
    }

    public void removeCurrent() {
        if (currentRow != null) {
            iterator.removeCurrent();
            currentRow = null;
            currentPos--;
            size--;
        }
    }

    public void reset() {
        super.reset();
        if (iterator != null) {
            iterator.release();
        }
        iterator = mainIndex.firstRow((Session) session, store, 0, null);
    }

    public void release() {
        if (isClosed) {
            return;
        }
        iterator.release();
        store.release();
        isClosed = true;
    }

    public void clear() {
        table.clearAllData(store);
        size = 0;
        reset();
    }

    public boolean isMemory() {
        return store.isMemory();
    }

    public void read(RowInputInterface in, ResultMetaData meta) {
    }

    public void write(RowOutputInterface out, ResultMetaData meta) {
        reset();
        out.writeLong(id);
        out.writeInt(size);
        // offset
        out.writeInt(0);
        out.writeInt(size);
        while (hasNext()) {
            Object[] data = getNext();
            out.writeData(meta.getExtendedColumnCount(), meta.columnTypes, data, null, null);
        }
        reset();
    }

    public Object[] getData(Long rowId) {
        tempRowData[0] = rowId;
        RowIterator it = idIndex.findFirstRow((Session) session, store, tempRowData, idIndex.getDefaultColumnMap());
        return it.getNext();
    }

    public void copy(RowSetNavigatorData other, int[] rightColumnIndexes) {
        while (other.hasNext()) {
            Object[] currentData = other.getNext();
            addAdjusted(currentData, rightColumnIndexes);
        }
        other.release();
    }

    public void union(Session session, RowSetNavigatorData other) {
        Object[] currentData;
        int colCount = table.getColumnTypes().length;
        removeDuplicates(session);
        other.reset();
        while (other.hasNext()) {
            currentData = other.getNext();
            RowIterator it = findFirstRow(currentData);
            if (!it.hasNext()) {
                currentData = (Object[]) ArrayUtil.resizeArrayIfDifferent(currentData, colCount);
                add(currentData);
            }
            it.release();
        }
        other.release();
        reset();
    }

    public void intersect(Session session, RowSetNavigatorData other) {
        removeDuplicates(session);
        other.sortFull(session);
        while (hasNext()) {
            Object[] currentData = getNext();
            boolean hasRow = other.containsRow(currentData);
            if (!hasRow) {
                removeCurrent();
            }
        }
        other.release();
    }

    public void intersectAll(Session session, RowSetNavigatorData other) {
        Object[] compareData = null;
        RowIterator it;
        Row otherRow = null;
        Object[] otherData = null;
        sortFull(session);
        other.sortFull(session);
        it = fullIndex.emptyIterator();
        while (hasNext()) {
            Object[] currentData = getNext();
            boolean newGroup = compareData == null || fullIndex.compareRowNonUnique(session, currentData, compareData, fullIndex.getColumnCount()) != 0;
            if (newGroup) {
                compareData = currentData;
                it = other.findFirstRow(currentData);
            }
            otherRow = it.getNextRow();
            otherData = otherRow == null ? null : otherRow.getData();
            if (otherData != null && fullIndex.compareRowNonUnique(session, currentData, otherData, fullIndex.getColumnCount()) == 0) {
                continue;
            }
            removeCurrent();
        }
        other.release();
    }

    public void except(Session session, RowSetNavigatorData other) {
        removeDuplicates(session);
        other.sortFull(session);
        while (hasNext()) {
            Object[] currentData = getNext();
            boolean hasRow = other.containsRow(currentData);
            if (hasRow) {
                removeCurrent();
            }
        }
        other.release();
    }

    public void exceptAll(Session session, RowSetNavigatorData other) {
        Object[] compareData = null;
        RowIterator it;
        Row otherRow = null;
        Object[] otherData = null;
        sortFull(session);
        other.sortFull(session);
        it = fullIndex.emptyIterator();
        while (hasNext()) {
            Object[] currentData = getNext();
            boolean newGroup = compareData == null || fullIndex.compareRowNonUnique(session, currentData, compareData, fullIndex.getColumnCount()) != 0;
            if (newGroup) {
                compareData = currentData;
                it = other.findFirstRow(currentData);
            }
            otherRow = it.getNextRow();
            otherData = otherRow == null ? null : otherRow.getData();
            if (otherData != null && fullIndex.compareRowNonUnique(session, currentData, otherData, fullIndex.getColumnCount()) == 0) {
                removeCurrent();
            }
        }
        other.release();
    }

    public boolean hasUniqueNotNullRows(Session session) {
        sortFull(session);
        Object[] lastRowData = null;
        while (hasNext()) {
            Object[] currentData = getNext();
            if (hasNull(currentData)) {
                continue;
            }
            if (lastRowData != null && fullIndex.compareRow(session, lastRowData, currentData) == 0) {
                return false;
            } else {
                lastRowData = currentData;
            }
        }
        return true;
    }

    public void removeDuplicates(Session session) {
        sortFull(session);
        Object[] lastRowData = null;
        while (next()) {
            Object[] currentData = getCurrent();
            if (lastRowData != null && fullIndex.compareRow(session, lastRowData, currentData) == 0) {
                removeCurrent();
            } else {
                lastRowData = currentData;
            }
        }
        reset();
    }

    public void trim(int limitstart, int limitcount) {
        if (size == 0) {
            return;
        }
        if (limitstart >= size) {
            clear();
            return;
        }
        if (limitstart != 0) {
            reset();
            for (int i = 0; i < limitstart; i++) {
                next();
                removeCurrent();
            }
        }
        if (limitcount == 0 || limitcount >= size) {
            return;
        }
        reset();
        for (int i = 0; i < limitcount; i++) {
            next();
        }
        while (hasNext()) {
            next();
            removeCurrent();
        }
    }

    boolean hasNull(Object[] data) {
        for (int i = 0; i < visibleColumnCount; i++) {
            if (data[i] == null) {
                return true;
            }
        }
        return false;
    }

    /**
     * Special case for isSimpleAggregate cannot use index lookup.
     */
    public Object[] getGroupData(Object[] data) {
        if (isSimpleAggregate) {
            if (simpleAggregateData == null) {
                simpleAggregateData = data;
                return null;
            }
            return simpleAggregateData;
        }
        RowIterator it = groupIndex.findFirstRow((Session) session, store, data);
        if (it.hasNext()) {
            Row row = it.getNextRow();
            if (isAggregate) {
                row.setChanged(true);
            }
            return row.getData();
        }
        return null;
    }

    boolean containsRow(Object[] data) {
        RowIterator it = mainIndex.findFirstRow((Session) session, store, data);
        boolean result = it.hasNext();
        it.release();
        return result;
    }

    RowIterator findFirstRow(Object[] data) {
        return mainIndex.findFirstRow((Session) session, store, data);
    }
}

18 View Complete Implementation : RowStoreAVL.java
Copyright Apache License 2.0
Author : SERG-Delft
/**
 * Basic delete with no logging or referential checks.
 */
public void delete(Session session, Row row) {
    writeLock();
    try {
        for (int i = 0; i < indexList.length; i++) {
            indexList[i].delete(session, this, row);
        }
        for (int i = 0; i < subStores.length; i++) {
            subStores[i].delete(session, row);
        }
        row.delete(this);
        long count = elementCount.decrementAndGet();
        if (count > 16 * 1024 && count < baseElementCount / 2) {
            baseElementCount = count;
            searchCost = null;
        }
    } finally {
        writeUnlock();
    }
}

18 View Complete Implementation : RowStoreAVLDiskData.java
Copyright Apache License 2.0
Author : SERG-Delft
public void postCommitAction(Session session, RowAction action) {
    if (action.getType() == RowAction.ACTION_DELETE_FINAL && !action.isDeleteComplete()) {
        action.setDeleteComplete();
        Row row = action.getRow();
        if (row == null) {
            row = (Row) get(action.getPos(), false);
        }
        delete(session, row);
        remove(row);
    }
}

18 View Complete Implementation : RowStoreAVLHybridExtended.java
Copyright Apache License 2.0
Author : SERG-Delft
private void resetAccessorKeysForCached(Index[] keys) {
    TableBase newTable = table.duplicate();
    newTable.persistenceId = table.persistenceId;
    newTable.setIndexes(keys);
    RowStoreAVLHybrid tempStore = new RowStoreAVLHybridExtended(session, newTable, true);
    tempStore.changeToDiskTable(session);
    RowIterator iterator = rowIterator();
    while (iterator.hasNext()) {
        Row row = iterator.getNextRow();
        Row newRow = (Row) tempStore.getNewCachedObject(session, row.getData(), false);
        tempStore.indexRow(session, newRow);
    }
    indexList = keys;
    accessorList = tempStore.accessorList;
}