Using MyBatis, I find myself having many mapper interfaces, e.g.
public interface BlogMapper {
@Select("SELECT * FROM blog WHERE id = #{id}")
Blog selectBlog(int id);
}
Which are retrieved on demand using a MyBatis factory
final BlogMapper mapper = session.getMapper(BlogMapper.class);
Now, I'd like to allow constructor injection of those interfaces (implemented under the hood by MyBatis), so I cannot explicitly
container.addComponent(...);
What's the best way to accomplish this?
I suppose some kind of or ComponentAdapter
ComponentMonitor
would be the right pick.