public void fillWith(SQLiteStatement stmt) throws SQLiteException { //Android caches results in the WindowedCursor to allow moveToPrevious() to function. //Robolectric will have to cache the results too. In the rows list. while (stmt.step()) { rows.add(fillRowValues(stmt)); } }
@Override public Long call(final SQLiteStatement statement) throws Exception { if (!statement.step()) { throw new SQLiteException(SQLiteConstants.SQLITE_DONE, "No rows returned from query"); } return statement.columnLong(0); } });
@Override public String call(final SQLiteStatement statement) throws Exception { if (!statement.step()) { throw new SQLiteException(SQLiteConstants.SQLITE_DONE, "No rows returned from query"); } return statement.columnString(0); } });
@Override public void beginWindow(long windowId) { try { beginStatement.step(); beginStatement.reset(); } catch (SQLiteException ex) { throw new RuntimeException(ex); } }
public void fillWith(SQLiteStatement stmt) throws SQLiteException { //Android caches results in the WindowedCursor to allow moveToPrevious() to function. //Robolectric will have to cache the results too. In the rows list. while (stmt.step()) { rows.add(fillRowValues(stmt)); } }
public void fillWith(SQLiteStatement stmt) throws SQLiteException { //Android caches results in the WindowedCursor to allow moveToPrevious() to function. //Robolectric will have to cache the results too. In the rows list. while (stmt.step()) { rows.add(fillRowValues(stmt)); } }
@Override public void beginWindow(long windowId) { try { beginStatement.step(); beginStatement.reset(); } catch (SQLiteException ex) { throw new RuntimeException(ex); } }
@Override public Long call() throws SQLiteException { SQLiteStatement stmt = stmt(connectionPtr, statementPtr); if (!stmt.step()) { throw new SQLiteException(SQLiteConstants.SQLITE_DONE, "No rows returned from query"); } return stmt.columnLong(0); } });
@Override public String call() throws SQLiteException { SQLiteStatement stmt = stmt(connectionPtr, statementPtr); if (!stmt.step()) { throw new SQLiteException(SQLiteConstants.SQLITE_DONE, "No rows returned from query"); } return stmt.columnString(0); } });
@Override public String call(final SQLiteStatement statement) throws Exception { if (!statement.step()) { throw new SQLiteException(SQLiteConstants.SQLITE_DONE, "No rows returned from query"); } return statement.columnString(0); } });
@Override public String call(final SQLiteStatement statement) throws Exception { if (!statement.step()) { throw new SQLiteException(SQLiteConstants.SQLITE_DONE, "No rows returned from query"); } return statement.columnString(0); } });
public long extractSingleLong() throws SQLiteException { this.stmt.step(); long result = this.stmt.columnLong(0); this.dispose(); return result; }
public int extractSingleInt() throws SQLiteException { this.stmt.step(); int result = this.stmt.columnInt(0); this.dispose(); return result; }
public double extractSingleDouble() throws SQLiteException { this.stmt.step(); double result = this.stmt.columnDouble(0); this.dispose(); return result; }
@Override public Long call() throws SQLiteException { SQLiteStatement stmt = stmt(connectionPtr, statementPtr); if (!stmt.step()) { throw new SQLiteException(SQLiteConstants.SQLITE_DONE, "No rows returned from query"); } return stmt.columnLong(0); } });
@Override public String call() throws SQLiteException { SQLiteStatement stmt = stmt(connectionPtr, statementPtr); if (!stmt.step()) { throw new SQLiteException(SQLiteConstants.SQLITE_DONE, "No rows returned from query"); } return stmt.columnString(0); } });
public <T> List<T> extractRecordList(ISQLiteRecordExtraction<T> extractor) throws SQLiteException { List<T> records = new ArrayList<T>(); if (this.isStatementDisposed() == false) { // Iterate over each record while (this.stmt.step()) { records.add(extractor.extract(new SQLiteRecord(this))); } // Dispose the statement this.dispose(); } return records; }
public <T> T extractRecord(ISQLiteRecordExtraction<T> extractor) throws SQLiteException { this.stmt.step(); T obj = extractor.extract(new SQLiteRecord(this)); this.dispose(); return obj; }
public byte[] extractSingleBlob() throws SQLiteException { this.stmt.step(); if ( !stmt.hasRow() ) return null; byte[] result = this.stmt.columnBlob(0); this.dispose(); return result; }
public void forEachRecord(ISQLiteRecordOperation op) throws SQLiteException { if (this.isStatementDisposed() == false) { // Iterate over each record int idx = 0; while (this.stmt.step()) { op.execute(new SQLiteRecord(this), idx); idx++; } // Dispose the statement this.dispose(); } }