@Test void testGetConfigValue_no_stmt() throws SQLException { assertNull(repository.getConfigValue("test")); }
public String getConfigValue(String key) { if (selectOne != null) { try { selectOne.setString(1, key); ResultSet rs = selectOne.executeQuery(); if (rs.next()) { return rs.getString(1); } } catch (SQLException e) { log.log(Level.FINE, () -> "query for config value failed: " + e.getMessage()); } } return null; }
Repository { public String getConfigValue(String key) { if (selectOne != null) { try { selectOne.setString(1, key); ResultSet rs = selectOne.executeQuery(); if (rs.next()) { return rs.getString(1); } } catch (SQLException e) { log.log(Level.FINE, () -> "query for config value failed: " + e.getMessage()); } } return null; } }
Repository { public String getConfigValue(String key) { if (selectOne != null) { try { selectOne.setString(1, key); ResultSet rs = selectOne.executeQuery(); if (rs.next()) { return rs.getString(1); } } catch (SQLException e) { log.log(Level.FINE, () -> "query for config value failed: " + e.getMessage()); } } return null; } Repository(Config config); }
Repository { public String getConfigValue(String key) { if (selectOne != null) { try { selectOne.setString(1, key); ResultSet rs = selectOne.executeQuery(); if (rs.next()) { return rs.getString(1); } } catch (SQLException e) { log.log(Level.FINE, () -> "query for config value failed: " + e.getMessage()); } } return null; } Repository(Config config); Map<String, String> getAllConfigValues(); String getConfigValue(String key); }
Repository { public String getConfigValue(String key) { if (selectOne != null) { try { selectOne.setString(1, key); ResultSet rs = selectOne.executeQuery(); if (rs.next()) { return rs.getString(1); } } catch (SQLException e) { log.log(Level.FINE, () -> "query for config value failed: " + e.getMessage()); } } return null; } Repository(Config config); Map<String, String> getAllConfigValues(); String getConfigValue(String key);  }