RestSqlAdapter implements IDatabaseAdapter { @Override public int[] insert(final String table, final Map<String, ? extends Object> values) throws SQLException { return this.insert(this.queryBuilder.buildInsertSQLCommand(table, values)); } RestSqlAdapter(final IRestDatabaseConfig config); List<IKVStore> select(final String query); @Override int[] insert(final String table, final Map<String, ? extends Object> values); @Override int[] insertMultiple(final String tablename, final List<String> keys, final List<List<?>> values); int[] insert(final String query); @Override int update(final String query); @Override List<IKVStore> query(final String query); JsonNode executeRESTCall(final String URL, final String query); @Override int update(final String tablename, final Map<String, ? extends Object> valuesToWrite, final Map<String, ? extends Object> where); static String whereClauseElement(final String key, final String value); @Override String getLoggerName(); @Override void setLoggerName(final String name); @Override void checkConnection(); @Override void createTable(final String tablename, final String nameOfPrimaryField, final Collection<String> fieldnames, final Map<String, String> types, final Collection<String> keys); @Override List<IKVStore> getRowsOfTable(final String table, final Map<String, String> conditions); @Override List<IKVStore> getResultsOfQuery(final String query, final List<String> values); @Override int[] insert(final String sql, final List<? extends Object> values); @Override int[] insertMultiple(final String table, final List<String> keys, final List<List<? extends Object>> datarows, final int chunkSize); @Override int update(final String sql, final List<? extends Object> values); @Override void executeQueriesAtomically(final List<PreparedStatement> queries); @Override void close();  }
@Test @Ignore public void testInsertQuery() throws SQLException { int numEntriesBefore = this.numEntries(DELETE_FROM_INSERT_TABLE); adapter.insert("INSERT INTO " + DELETE_FROM_INSERT_TABLE + " (y) VALUES (2)"); int numEntriesAfter = this.numEntries(DELETE_FROM_INSERT_TABLE); assertTrue("No entry added!", numEntriesAfter > numEntriesBefore); }
@Test @Ignore public void testRemoveEntryQuery() throws SQLException { int numEntriesBefore = this.numEntries(DELETE_FROM_INSERT_TABLE); adapter.insert("DELETE FROM " + DELETE_FROM_INSERT_TABLE + " LIMIT 1"); int numEntriesAfter = this.numEntries(DELETE_FROM_INSERT_TABLE); assertTrue("No entry added!", numEntriesAfter < numEntriesBefore); }