Clinton Begin wrote:
List selectList(String statement, Object parameter, RowBounds rowBounds)
void select(String statement, Object parameter, RowBounds rowBounds,
ResultHandler handler)
These methods used to take two int params to define the OFFSET and LIMIT
for limiting the rows that were returned (for paging etc) We've
introduced the RowBounds class to clean that up, but also to allow for
multi-parameter bindings. So that this is now possible in Mapper classes:
List<Post> findAllPostsLike(@Param("subject") String
subject, @Param("body") String body, RowBounds rowBounds);
RowBounds can be any parameter, not necessarily the last one. You don't
have to specify @Param, as it will default to using the ordinal position
e.g. #{1} #{2}, but with the @Param annotations, you can use #{subject}
and #{body}. If you only specify a single parameter, then it's passed
as always, as the top level parameter (with all properties accessible by
name without qualification).
Clinton, thank you very much for the tremendous amount of effort you put
into iBatis.
I'm unclear about the XML implementation of multiple parameter bindings.
I couldn't find any full examples in the PDF, so I looked in
XMLStatementBuilder.java. Looks like parameterType is still a
single-valued entry. So, with the example you provide above, what would
we enter for parameterType in the XML file? Seems like parameterType
will have to become a multi-valued list (comma-separated or some
alternative.)
--
Guy Rouillier
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]