@Test public void testCall() throws Exception { for (int i = 0; i < DB_MODE; i++) { BatchCallBuilder cb = new BatchCallBuilder(SP_WITHOUT_OUT_PARAM); cb.registerInput("v_id", JDBCType.INTEGER); cb.registerInput("v_cityID", JDBCType.INTEGER); cb.registerInput("v_countryID", JDBCType.INTEGER); cb.registerInput("v_name", JDBCType.VARCHAR); cb.hints().inShard(i); cb.addBatch(7, 7, 7, "777"); cb.addBatch(17, 17, 17, "1777"); cb.addBatch(27, 27, 27, "2777"); int[] ret = dao.batchCall(cb); assertArrayEquals(new int[]{1, 1, 1}, ret); Person p = new Person(); p.setPeopleID(7); p = dao.queryByPk(p, Hints.hints().inShard(i)); assertEquals("777", p.getName()); p = new Person(); p.setPeopleID(17); p = dao.queryByPk(p, Hints.hints().inShard(i)); assertEquals("1777", p.getName()); p = new Person(); p.setPeopleID(27); p = dao.queryByPk(p, Hints.hints().inShard(i)); assertEquals("2777", p.getName()); } }
public static BatchCallBuilder call(String name) { return new BatchCallBuilder(name); }
BatchCallBuilder implements Segment, ParameterDefinitionProvider { public static BatchCallBuilder call(String name) { return new BatchCallBuilder(name); } }
BatchCallBuilder implements Segment, ParameterDefinitionProvider { public static BatchCallBuilder call(String name) { return new BatchCallBuilder(name); } BatchCallBuilder(String name); }
BatchCallBuilder implements Segment, ParameterDefinitionProvider { public static BatchCallBuilder call(String name) { return new BatchCallBuilder(name); } BatchCallBuilder(String name); static BatchCallBuilder call(String name); BatchCallBuilder setHints(Hints hints); BatchCallBuilder registerOutput(String name, JDBCType type); BatchCallBuilder registerInput(String name, JDBCType type); BatchCallBuilder registerInputOutput(String name, JDBCType type); void addBatch(Object...values); Hints hints(); String getName(); List<ParameterDefinition> getParameterDefinitions(); List<Object[]> getValuesList(); @Override List<ParameterDefinition> buildDefinitions(); @Override String build(BuilderContext context); @Override String toString(); }
BatchCallBuilder implements Segment, ParameterDefinitionProvider { public static BatchCallBuilder call(String name) { return new BatchCallBuilder(name); } BatchCallBuilder(String name); static BatchCallBuilder call(String name); BatchCallBuilder setHints(Hints hints); BatchCallBuilder registerOutput(String name, JDBCType type); BatchCallBuilder registerInput(String name, JDBCType type); BatchCallBuilder registerInputOutput(String name, JDBCType type); void addBatch(Object...values); Hints hints(); String getName(); List<ParameterDefinition> getParameterDefinitions(); List<Object[]> getValuesList(); @Override List<ParameterDefinition> buildDefinitions(); @Override String build(BuilderContext context); @Override String toString();  }