I can't make much sense of the documentation as it is very sparse on this topic and always mixes different styles of querying.
So: I have this code snippet, that works fine, using XML only: Map params = new HashMap(); params.put("start", start); params.put("limit", limit); params.put("sortFieldName", sortFieldName); params.put("sortDirection", sortDirection); List<UserDto> users = sqlSession.selectList("com.acme.foo.mapper.UserMapper.selectPage", params); Now I tried to use this mapper class instead, to get cleaner code: public interface UserMapper { List<UserDto> selectPage(int start, int limit, String sortFieldName, String sortDirection); Is that supposed to work? All I get is an SQL exception telling me that the statement is not terminated properly.