private void insertRow(int id, @Nullable RuleScope scope) { dbTester.executeInsert( "RULES", "PLUGIN_RULE_KEY", "key_" + id, "PLUGIN_NAME", "name_" + id, "SCOPE", scope == null ? null : scope.name()); } }
private void insertRow(int id) { db.executeInsert( "RULES", "PLUGIN_RULE_KEY", "key_" + id, "PLUGIN_NAME", "name_" + id, "SCOPE", RuleScope.MAIN.name()); } }
@Override protected void execute(Context context) throws SQLException { long now = system2.now(); MassUpdate massUpdate = context.prepareMassUpdate(); massUpdate.select("select id from rules where scope is NULL"); massUpdate.rowPluralName("rules"); massUpdate.update("update rules set scope=?, updated_at=? where scope is NULL"); massUpdate.execute((row, update) -> { update.setString(1, RuleScope.MAIN.name()); update.setLong(2, now); return true; }); } }
changed = true; if (!StringUtils.equals(dto.getScope().name(), def.scope().name())) { dto.setScope(toDtoScope(def.scope())); changed = true;
@Override protected void execute(Context context) throws SQLException { long now = system2.now(); MassUpdate massUpdate = context.prepareMassUpdate(); massUpdate.select("select id from rules where scope is NULL"); massUpdate.rowPluralName("rules"); massUpdate.update("update rules set scope=?, updated_at=? where scope is NULL"); massUpdate.execute((row, update) -> { update.setString(1, RuleScope.MAIN.name()); update.setLong(2, now); return true; }); } }
changed = true; if (!StringUtils.equals(dto.getScope().name(), def.scope().name())) { dto.setScope(toDtoScope(def.scope())); changed = true;