@Override StringBuilder buildQueryString(List<Object> variables, CodecRegistry codecRegistry) { StringBuilder builder = new StringBuilder(); builder.append( isCounterOp() ? "BEGIN COUNTER BATCH" : (logged ? "BEGIN BATCH" : "BEGIN UNLOGGED BATCH")); if (!usings.usings.isEmpty()) { builder.append(" USING "); Utils.joinAndAppend(builder, codecRegistry, " AND ", usings.usings, variables); } builder.append(' '); for (int i = 0; i < statements.size(); i++) { RegularStatement stmt = statements.get(i); if (stmt instanceof BuiltStatement) { BuiltStatement bst = (BuiltStatement) stmt; builder.append(maybeAddSemicolon(bst.buildQueryString(variables, codecRegistry))); } else { String str = stmt.getQueryString(codecRegistry); builder.append(str); if (!str.trim().endsWith(";")) builder.append(';'); // Note that we force hasBindMarkers if there is any non-BuiltStatement, so we know // that we can only get there with variables == null assert variables == null; } } builder.append("APPLY BATCH;"); return builder; }
@Override StringBuilder buildQueryString(List<Object> variables, CodecRegistry codecRegistry) { StringBuilder builder = new StringBuilder(); builder.append(isCounterOp() ? "BEGIN COUNTER BATCH" : (logged ? "BEGIN BATCH" : "BEGIN UNLOGGED BATCH")); if (!usings.usings.isEmpty()) { builder.append(" USING "); Utils.joinAndAppend(builder, codecRegistry, " AND ", usings.usings, variables); } builder.append(' '); for (int i = 0; i < statements.size(); i++) { RegularStatement stmt = statements.get(i); if (stmt instanceof BuiltStatement) { BuiltStatement bst = (BuiltStatement) stmt; builder.append(maybeAddSemicolon(bst.buildQueryString(variables, codecRegistry))); } else { String str = stmt.getQueryString(codecRegistry); builder.append(str); if (!str.trim().endsWith(";")) builder.append(';'); // Note that we force hasBindMarkers if there is any non-BuiltStatement, so we know // that we can only get there with variables == null assert variables == null; } } builder.append("APPLY BATCH;"); return builder; }
@Override StringBuilder buildQueryString(List<Object> variables, CodecRegistry codecRegistry) { StringBuilder builder = new StringBuilder(); builder.append(isCounterOp() ? "BEGIN COUNTER BATCH" : (logged ? "BEGIN BATCH" : "BEGIN UNLOGGED BATCH")); if (!usings.usings.isEmpty()) { builder.append(" USING "); Utils.joinAndAppend(builder, codecRegistry, " AND ", usings.usings, variables); } builder.append(' '); for (int i = 0; i < statements.size(); i++) { RegularStatement stmt = statements.get(i); if (stmt instanceof BuiltStatement) { BuiltStatement bst = (BuiltStatement) stmt; builder.append(maybeAddSemicolon(bst.buildQueryString(variables, codecRegistry))); } else { String str = stmt.getQueryString(codecRegistry); builder.append(str); if (!str.trim().endsWith(";")) builder.append(';'); // Note that we force hasBindMarkers if there is any non-BuiltStatement, so we know // that we can only get there with variables == null assert variables == null; } } builder.append("APPLY BATCH;"); return builder; }
@Override StringBuilder buildQueryString(List<Object> variables, CodecRegistry codecRegistry) { StringBuilder builder = new StringBuilder(); builder.append(isCounterOp() ? "BEGIN COUNTER BATCH" : (logged ? "BEGIN BATCH" : "BEGIN UNLOGGED BATCH")); if (!usings.usings.isEmpty()) { builder.append(" USING "); Utils.joinAndAppend(builder, codecRegistry, " AND ", usings.usings, variables); } builder.append(' '); for (int i = 0; i < statements.size(); i++) { RegularStatement stmt = statements.get(i); if (stmt instanceof BuiltStatement) { BuiltStatement bst = (BuiltStatement) stmt; builder.append(maybeAddSemicolon(bst.buildQueryString(variables, codecRegistry))); } else { String str = stmt.getQueryString(codecRegistry); builder.append(str); if (!str.trim().endsWith(";")) builder.append(';'); // Note that we force hasBindMarkers if there is any non-BuiltStatement, so we know // that we can only get there with variables == null assert variables == null; } } builder.append("APPLY BATCH;"); return builder; }
if (stmt instanceof BuiltStatement) { BuiltStatement bst = (BuiltStatement)stmt; builder.append(maybeAddSemicolon(bst.buildQueryString(variables)));