ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brandon Goodin" <brandon.goo...@gmail.com>
Subject Re: PaginatedList
Date Tue, 04 Sep 2007 18:24:57 GMT
Hey John,

skip and max do not need to be passed to your <select>. These values are
used when iBATIS is traversing the resultset that is returned from the
database. For example, you query the database and it has 300 potential
records returned in the resultset. If skip is set to 50 and max is set to
100, iBATIS will begin at record 50 and map the next 100 records into your
resultClass/resultMap defined objects.

Brandon

On 9/4/07, John Chien <john.chien@ncmail.net> wrote:
>
>  Brandon:
>
> Thank you for the response.
> Should be all four parameters be included in the  <statement > ?
> If yes, how ?
>
> <statement id="id" parameterclass="parameterObjectClass", .... ......,
> resultClass="resulyObjectClass">
>    SELECT  STATEMENT
> </statement>
>
> Brandon Goodin wrote:
>
> There is no replacement needed. The SqlMap contains a method called
> queryForList(String id, Object parameter, int skip, int max). See the
> javadoc below. This will accomplish what you want. We've decided that the
> PaginatedList is outside the scope of iBATIS and oft abused. That is why we
> deprecated it.
>
> queryForList
>
> public java.util.List *queryForList*(java.lang.String id,
>                                    java.lang.Object parameterObject,
>                                    int skip,
>                                    int max)
>
>                             throws java.sql.SQLException
>
>  Executes a mapped SQL SELECT statement that returns data to populate a
> number of result objects within a certain range.
>
> The parameter object is generally used to supply the input data for the
> WHERE clause parameter(s) of the SELECT statement.
>
>   *Parameters:* id - The name of the statement to execute. parameterObject- The parameter
object (
> e.g. JavaBean, Map, XML etc.). skip - The number of results to ignore. max- The maximum
number of results to return.
> *Returns:* A List of result objects. *Throws:* java.sql.SQLException - If
> an error occurs.  queryForList
>
> public java.util.List *queryForList*(java.lang.String id,
>                                    int skip,
>                                    int max)
>                             throws java.sql.SQLException
>
>  Executes a mapped SQL SELECT statement that returns data to populate a
> number of result objects within a certain range.
>
> This overload assumes no parameter is needed.
>
>   *Parameters:* id - The name of the statement to execute. skip - The
> number of results to ignore. max - The maximum number of results to
> return. *Returns:* A List of result objects. *Throws:*
> java.sql.SQLException - If an error occurs.  Cheers,
> Brandon
>
> On 8/31/07, *John Chien* <john.chien@ncmail.net> wrote:
>
>
> Dear Sir:
>
> I heard that paginated list will be removed from IBatis. Is it true ?
> If that is true, what is the replacement ?
>
> Thanks,
>
> John Chien
>
>
>
>

Mime
View raw message