Hi All,
I've read through the user guide, past discussions in the group, and the MyBatis source, and I think I understand how I'd use a BatchExecutor to execute a batch and get back BatchResults for the executed statements, but I wanted to confirm that I'm on the right track. Does code like the following (ignoring error handling for the moment) look reasonable?
SqlSession session = ssFactory.openSession(ExecutorType.BATCH);
GroupMapper mapper = session.getMapper(GroupMapper.class);
for (Group group : groups) {
mapper.addGroup(group);
}
List<BatchResult> results = session.flushStatements();
session.commit();
session.close();
Thanks,
Matt