KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ibatis > sqlmap > client > event > RowHandler


1 /*
2  * Copyright 2004 Clinton Begin
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package com.ibatis.sqlmap.client.event;
17
18
19 /**
20  * Event handler for row by row processing.
21  * <p/>
22  * The RowHandler interface is used by the SqlMapSession.queryWithRowHandler() method.
23  * Generally a RowHandler implementation will perform some row-by-row processing logic
24  * in cases where there are too many rows to efficiently load into memory.
25  * <p/>
26  * Example:
27  * <pre>
28  * sqlMap.queryWithRowHandler ("findAllEmployees", null, new MyRowHandler()));
29  * </pre>
30  */

31 public interface RowHandler {
32
33   /**
34    * Handles a single row of a result set.
35    * <p/>
36    * This method will be called for each row in a result set. For each row the result map
37    * will be applied to build the value object, which is then passed in as the valueObject
38    * parameter.
39    *
40    * @param valueObject The object representing a single row from the query.
41    * @see com.ibatis.sqlmap.client.SqlMapSession
42    */

43   void handleRow(Object JavaDoc valueObject);
44
45 }
46
Popular Tags