CallBuilder implements Segment, ParameterProvider { public static CallBuilder call(String name) { return new CallBuilder(name); } CallBuilder(String name); static CallBuilder call(String name); CallBuilder setHints(Hints hints); CallBuilder registerOutput(String name, JDBCType type); CallBuilder registerInput(String name, JDBCType type, Object value); CallBuilder registerInputOutput(String name, JDBCType type, Object value); String getName(); boolean isCallByIndex(); CallBuilder setCallByIndex(boolean callByIndex); List<Parameter> getParameters(); Hints hints(); @Override List<Parameter> buildParameters(); T getOutput(String name); @Override String build(BuilderContext context); @Override String toString();  }
@Test public void testCall() throws Exception { for (int i = 0; i < DB_MODE; i++) { CallBuilder cb = new CallBuilder(SP_WITHOUT_OUT_PARAM); cb.registerInput("v_id", JDBCType.INTEGER, 7); cb.registerInput("v_cityID", JDBCType.INTEGER, 7); cb.registerInput("v_countryID", JDBCType.INTEGER, 7); cb.registerInput("v_name", JDBCType.VARCHAR, "666"); cb.hints().inShard(i); dao.call(cb); Person p = new Person(); p.setPeopleID(7); p = dao.queryByPk(p, Hints.hints().inShard(i)); assertEquals("666", p.getName()); } }