@Test public void testBatchQueryBuilder() throws Exception { PersonDefinition p = Person.PERSON; BatchQueryBuilder batchBuilder = new BatchQueryBuilder(); for (int k = 0; k < TABLE_MODE; k++) { batchBuilder.addBatch(selectAllFrom(p).where().allOf(p.PeopleID.eq(k+1)).orderBy(p.PeopleID.asc()).into(Person.class)); } Hints hints = batchBuilder.hints().diagnose(); List<List<Person>> plist = (List<List<Person>>)dao.batchQuery(batchBuilder); if(this.dbCategory == SqlServer) { assertTrue(hints.getDiagnose().toString().contains(SegmentConstants.WITH_NO_LOCK.getText())); } assertEquals(TABLE_MODE, plist.size()); for (int k = 0; k < TABLE_MODE; k++) { List<Person> list = plist.get(k); assertEquals(1, list.size()); Person pk = list.get(0); assertNotNull(p); assertEquals(k+1, pk.getPeopleID().intValue()); assertEquals("test", pk.getName()); } }
public List<?> batchQuery(BatchQueryBuilder builder) throws SQLException { final Hints hint = checkHints(builder.hints()); return internalExecute(hint, ()->{return delegate.batchQuery(builder);}); }
DasClient { public List<?> batchQuery(BatchQueryBuilder builder) throws SQLException { final Hints hint = checkHints(builder.hints()); return internalExecute(hint, ()->{return delegate.batchQuery(builder);}); } }
DasClient { public List<?> batchQuery(BatchQueryBuilder builder) throws SQLException { final Hints hint = checkHints(builder.hints()); return internalExecute(hint, ()->{return delegate.batchQuery(builder);}); } DasClient(DasDelegate delegate); }
DasClient { public List<?> batchQuery(BatchQueryBuilder builder) throws SQLException { final Hints hint = checkHints(builder.hints()); return internalExecute(hint, ()->{return delegate.batchQuery(builder);}); } DasClient(DasDelegate delegate); T queryByPk(T pk, Hints...hints); List<T> queryBySample(T sample, Hints...hints); List<T> queryBySample(T sample, PageRange range, Hints...hints); long countBySample(T sample, Hints...hints); int insert(T entity, Hints...hints); int insert(List<T> entities, Hints...hints); int[] batchInsert(List<T> entities, Hints...hints); int deleteByPk(T pk, Hints...hints); int deleteBySample(T sample, Hints...hints); int[] batchDelete(List<T> entities, Hints...hints); int update(T entity, Hints...hints); int[] batchUpdate(List<T> entities, Hints...hints); T queryObject(SqlBuilder builder); T queryObjectNullable(SqlBuilder builder); List<T> query(SqlBuilder builder); List<?> batchQuery(BatchQueryBuilder builder); int update(SqlBuilder builder); int[] batchUpdate(BatchUpdateBuilder builder); void call(CallBuilder builder); int[] batchCall(BatchCallBuilder builder); void execute(Transaction transaction, Hints...hints); T execute(CallableTransaction<T> transaction, Hints...hints); }
DasClient { public List<?> batchQuery(BatchQueryBuilder builder) throws SQLException { final Hints hint = checkHints(builder.hints()); return internalExecute(hint, ()->{return delegate.batchQuery(builder);}); } DasClient(DasDelegate delegate); T queryByPk(T pk, Hints...hints); List<T> queryBySample(T sample, Hints...hints); List<T> queryBySample(T sample, PageRange range, Hints...hints); long countBySample(T sample, Hints...hints); int insert(T entity, Hints...hints); int insert(List<T> entities, Hints...hints); int[] batchInsert(List<T> entities, Hints...hints); int deleteByPk(T pk, Hints...hints); int deleteBySample(T sample, Hints...hints); int[] batchDelete(List<T> entities, Hints...hints); int update(T entity, Hints...hints); int[] batchUpdate(List<T> entities, Hints...hints); T queryObject(SqlBuilder builder); T queryObjectNullable(SqlBuilder builder); List<T> query(SqlBuilder builder); List<?> batchQuery(BatchQueryBuilder builder); int update(SqlBuilder builder); int[] batchUpdate(BatchUpdateBuilder builder); void call(CallBuilder builder); int[] batchCall(BatchCallBuilder builder); void execute(Transaction transaction, Hints...hints); T execute(CallableTransaction<T> transaction, Hints...hints);  }