I am trying to get this answered, and found one comment in the MyBatis documentation:
Usually
MapperFactoryBean
is preferred to this class, since it requires no extra code. But, this class(DAO
) is useful if you need to do other non-MyBatis work in yourDAO
and concrete classes are required and useSqlSessionDaoSupport
orSqlSessionFactory
In case I chose to use MapperFactoryBean
today in my project, but later I would need to use concrete DAO
(may be because you may not do 100% using SQLs in mapper), then I need to change the design.
If the above is true, then MapperFactoryBean would be very less useful and would never(or mostly) be a choice.
In other words: Can MapperFactoryBean and DAO co-exists? Even if yes, should they be?