I like the XML notation for specifying global parameters such as connection strings. I also like Mapper annotations. When I try to combine the two, I get this exception.
When u create the mapper interface with the abstract methods having the exact method signature as the sql in the xml.
For eg. This was the namespace for the dao.xml which contained the actual query.
It will be mapped in the interface com.mybatis.dao.EntityMapperInterface
public interface EntityMapperInterface {
public List selectEmployeeWithId(Long id);
Mybatis-config file
How do u call it from the Action class/Servlet? When u have the SqlSession initialized,
EntityMapperInterface emi = session.getMapper(EntityMapperInterface.class);
List eList = emi.selectEmployeeWithId(1);