ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Friedrich <stephen.friedr...@fortis-it.eu>
Subject Parameters in Mapper class methods?
Date Wed, 18 Nov 2009 14:39:51 GMT
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.


Mime
View raw message