@Override public void run(@NotNull final DBSession session) { for (int i = 0; i < retries; ++i) { List<String> commands = session.query(metaQuery).withParams(params).run(); try { for (String command : commands) { if (command != null && command.length() > 0) { session.command(command).run(); } } i = retries + 1; } catch (DBException e) { if (i + 1 >= retries) throw e; } } } });
@Override public void run(@NotNull final DBSession session) { List<String> commands = session.query(metaQuery).withParams(params).run(); SqlScriptBuilder sb = new SqlScriptBuilder(); for (String command : commands) if (command != null && command.length() > 0) sb.add(command); SqlScript script = sb.build(); session.script(script).run(); } });
@Override public T run(@NotNull final DBTransaction tran) { return tran.query(query).withParams(params).run(); } });