void truncateTable() throws IOException { if ( table == null ) { return; } Cursor tableRows = Cursor.createCursor( table ); while ( tableRows.moveToNextRow() ) { tableRows.deleteCurrentRow(); } } }
public boolean moveToNextRow(Cursor cur, Set<String> columnNames) throws IOException { boolean hasNext = cur.moveToNextRow(); if (hasNext) { this.currentRow = cur.getCurrentRow(columnNames); } return hasNext; }
@Override protected int findMaxSyntheticId() throws IOException { // find max id < 0 ColumnImpl idCol = _systemCatalog.getColumn(CAT_COL_ID); _systemCatalogCursor.reset(); int curMaxSynthId = Integer.MIN_VALUE; while(_systemCatalogCursor.moveToNextRow()) { int id = (Integer)_systemCatalogCursor.getCurrentRowValue(idCol); if((id > curMaxSynthId) && (id < 0)) { curMaxSynthId = id; } } return curMaxSynthId; } }