@Test public void testInsertBulk() { String sql = "INSERT INTO Customer (documentID) VALUES ('customer-1')"; Insert insert = (Insert)translationUtility.parseCommand(sql); Parameter p = new Parameter(); p.setType(String.class); p.setValueIndex(0); ((ExpressionValueSource)insert.getValueSource()).getValues().set(0, p); insert.setParameterValues(Arrays.asList(Arrays.asList("customer-1"), Arrays.asList("customer-2")).iterator()); N1QLUpdateVisitor visitor = TRANSLATOR.getN1QLUpdateVisitor(); visitor.append(insert); String actual = visitor.getBulkCommands()[0]; assertEquals("INSERT INTO `test` (KEY, VALUE) VALUES ('customer-1', {\"type\":\"Customer\"}), VALUES ('customer-2', {\"type\":\"Customer\"}) RETURNING META(`test`).id AS PK", actual); }
public String[] getBulkCommands() { return bulkCommands; }
N1QLUpdateVisitor extends N1QLVisitor { public String[] getBulkCommands() { return bulkCommands; } }
N1QLUpdateVisitor extends N1QLVisitor { public String[] getBulkCommands() { return bulkCommands; } N1QLUpdateVisitor(CouchbaseExecutionFactory ef); }
N1QLUpdateVisitor extends N1QLVisitor { public String[] getBulkCommands() { return bulkCommands; } N1QLUpdateVisitor(CouchbaseExecutionFactory ef); @Override void visit(Insert obj); String[] getBulkCommands(); @Override void visit(NamedTable obj); @Override void visit(ColumnReference obj); @Override void visit(Delete obj); @Override void visit(Update obj); }
N1QLUpdateVisitor extends N1QLVisitor { public String[] getBulkCommands() { return bulkCommands; } N1QLUpdateVisitor(CouchbaseExecutionFactory ef); @Override void visit(Insert obj); String[] getBulkCommands(); @Override void visit(NamedTable obj); @Override void visit(ColumnReference obj); @Override void visit(Delete obj); @Override void visit(Update obj);  }