@Test public void executeStatement_delegatesToDatabase() { FinishedStatement statement = mock(FinishedStatement.class); when(statement.iterator()).thenReturn(new SqlPartIterator()); mStatementExecutor.execute(statement); verify(mDatabaseMock).execSQL(anyString(), any(Object[].class)); }
@Override public void execute(@NotNull final FinishedStatement finishedStatement) { String sql = mStatementConverter.toSql(finishedStatement); Object[] arguments = mStatementConverter.retrieveArguments(finishedStatement); mDatabase.execSQL(sql, arguments); }
AndroidStatementExecutor implements StatementExecutor<Cursor> { @Override public void execute(@NotNull final FinishedStatement finishedStatement) { String sql = mStatementConverter.toSql(finishedStatement); Object[] arguments = mStatementConverter.retrieveArguments(finishedStatement); mDatabase.execSQL(sql, arguments); } }
AndroidStatementExecutor implements StatementExecutor<Cursor> { @Override public void execute(@NotNull final FinishedStatement finishedStatement) { String sql = mStatementConverter.toSql(finishedStatement); Object[] arguments = mStatementConverter.retrieveArguments(finishedStatement); mDatabase.execSQL(sql, arguments); } AndroidStatementExecutor(@NotNull final SQLiteDatabase database); }
AndroidStatementExecutor implements StatementExecutor<Cursor> { @Override public void execute(@NotNull final FinishedStatement finishedStatement) { String sql = mStatementConverter.toSql(finishedStatement); Object[] arguments = mStatementConverter.retrieveArguments(finishedStatement); mDatabase.execSQL(sql, arguments); } AndroidStatementExecutor(@NotNull final SQLiteDatabase database); @Override void execute(@NotNull final FinishedStatement finishedStatement); @Override Cursor execute(@NotNull final FinishedSelectStatement finishedSelectStatement); @Override long execute(@NotNull final FinishedInsertStatement finishedInsertStatement); @Override long execute(@NotNull final FinishedUpdateStatement finishedUpdateStatement); @Override long execute(@NotNull final FinishedDeleteStatement finishedDeleteStatement); }
AndroidStatementExecutor implements StatementExecutor<Cursor> { @Override public void execute(@NotNull final FinishedStatement finishedStatement) { String sql = mStatementConverter.toSql(finishedStatement); Object[] arguments = mStatementConverter.retrieveArguments(finishedStatement); mDatabase.execSQL(sql, arguments); } AndroidStatementExecutor(@NotNull final SQLiteDatabase database); @Override void execute(@NotNull final FinishedStatement finishedStatement); @Override Cursor execute(@NotNull final FinishedSelectStatement finishedSelectStatement); @Override long execute(@NotNull final FinishedInsertStatement finishedInsertStatement); @Override long execute(@NotNull final FinishedUpdateStatement finishedUpdateStatement); @Override long execute(@NotNull final FinishedDeleteStatement finishedDeleteStatement);  }