Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Invalid
-
3.0 Beta 3
-
None
-
None
Description
Ibatis now support only one parametrs for query input. Use special class or map for input multiple parametrs is annoying.
It's not possible write this:
SendMapper sm = session.getMapper(SendMapper.class);
List<Send> ls = sm.getAllItems(10, 2);
and in SendMapper:
@Select({"SELECT * FROM send LIMIT #
{1}, #
{2}"})
List getAllItems(int offset, int limit);
OR
@Select({"SELECT * FROM send LIMIT #
{offset}, #{limit}"})List getAllItems(@Param("offset") int offset, @Param("limit") int limit);
OR use XML mapper:
<select id="getAllItems" parameters="offset:int,limit:int">
SELECT * FROM send LIMIT #{offset}
, #
{limit}<select>
or more java like syntax:
<select id="getAllItems" parameters="int offset, int limit">
SELECT * FROM send LIMIT #{offset}, #{limit}
<select>