@Test public void shouldUpdateContentsOfParameter() { database().withParameter("test").build(); ParameterDAO parameterDAO = get(ParameterDAO.class); QueryRunner runner = queryRunner(); Parameter updatedParameterData = parameter().withName("updatedTest").build(); parameterDAO.update(runner, "test", updatedParameterData); runner.close(); assertDatabase().hasNoParameter("test").hasParameter("updatedTest"); }
public void update(QueryRunner queryRunner, String parameterName, Parameter parameter) { UpdateQuery query = QueryFactory.update(configuration.parameterEntityName()).where("name = :name") .withArgument("name", parameterName) .set("name", parameter.getName()) .set("input_levels", parameter.getInputLevels()) .set("cacheable", parameter.isCacheable()) .set("nullable", parameter.isNullable()) .set("identify_entries", parameter.isIdentifyEntries()) .set("array_separator", parameter.getArraySeparator()); queryRunner.update(query); }
ParameterDAO { public void update(QueryRunner queryRunner, String parameterName, Parameter parameter) { UpdateQuery query = QueryFactory.update(configuration.parameterEntityName()).where("name = :name") .withArgument("name", parameterName) .set("name", parameter.getName()) .set("input_levels", parameter.getInputLevels()) .set("cacheable", parameter.isCacheable()) .set("nullable", parameter.isNullable()) .set("identify_entries", parameter.isIdentifyEntries()) .set("array_separator", parameter.getArraySeparator()); queryRunner.update(query); } }
ParameterDAO { public void update(QueryRunner queryRunner, String parameterName, Parameter parameter) { UpdateQuery query = QueryFactory.update(configuration.parameterEntityName()).where("name = :name") .withArgument("name", parameterName) .set("name", parameter.getName()) .set("input_levels", parameter.getInputLevels()) .set("cacheable", parameter.isCacheable()) .set("nullable", parameter.isNullable()) .set("identify_entries", parameter.isIdentifyEntries()) .set("array_separator", parameter.getArraySeparator()); queryRunner.update(query); } ParameterDAO(JdbcConfig configuration, SimpleQueryRunner simpleQueryRunner); }
ParameterDAO { public void update(QueryRunner queryRunner, String parameterName, Parameter parameter) { UpdateQuery query = QueryFactory.update(configuration.parameterEntityName()).where("name = :name") .withArgument("name", parameterName) .set("name", parameter.getName()) .set("input_levels", parameter.getInputLevels()) .set("cacheable", parameter.isCacheable()) .set("nullable", parameter.isNullable()) .set("identify_entries", parameter.isIdentifyEntries()) .set("array_separator", parameter.getArraySeparator()); queryRunner.update(query); } ParameterDAO(JdbcConfig configuration, SimpleQueryRunner simpleQueryRunner); long insert(QueryRunner queryRunner, Parameter parameter); void delete(QueryRunner queryRunner, String parameterName); Set<String> getParameterNames(); List<String> getParameterNames(ParameterFilter filter); JdbcParameter getParameter(QueryRunner queryRunner, String parameterName); boolean parameterExists(String parameterName); void update(QueryRunner queryRunner, String parameterName, Parameter parameter); }
ParameterDAO { public void update(QueryRunner queryRunner, String parameterName, Parameter parameter) { UpdateQuery query = QueryFactory.update(configuration.parameterEntityName()).where("name = :name") .withArgument("name", parameterName) .set("name", parameter.getName()) .set("input_levels", parameter.getInputLevels()) .set("cacheable", parameter.isCacheable()) .set("nullable", parameter.isNullable()) .set("identify_entries", parameter.isIdentifyEntries()) .set("array_separator", parameter.getArraySeparator()); queryRunner.update(query); } ParameterDAO(JdbcConfig configuration, SimpleQueryRunner simpleQueryRunner); long insert(QueryRunner queryRunner, Parameter parameter); void delete(QueryRunner queryRunner, String parameterName); Set<String> getParameterNames(); List<String> getParameterNames(ParameterFilter filter); JdbcParameter getParameter(QueryRunner queryRunner, String parameterName); boolean parameterExists(String parameterName); void update(QueryRunner queryRunner, String parameterName, Parameter parameter);  }