01: /*
02: * Copyright 2004 Clinton Begin
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: * Event handler for row by row processing.
20: * <p/>
21: * The RowHandler interface is used by the SqlMapSession.queryWithRowHandler() method.
22: * Generally a RowHandler implementation will perform some row-by-row processing logic
23: * in cases where there are too many rows to efficiently load into memory.
24: * <p/>
25: * Example:
26: * <pre>
27: * sqlMap.queryWithRowHandler ("findAllEmployees", null, new MyRowHandler()));
28: * </pre>
29: */
30: public interface RowHandler {
31:
32: /**
33: * Handles a single row of a result set.
34: * <p/>
35: * This method will be called for each row in a result set. For each row the result map
36: * will be applied to build the value object, which is then passed in as the valueObject
37: * parameter.
38: *
39: * @param valueObject The object representing a single row from the query.
40: * @see com.ibatis.sqlmap.client.SqlMapSession
41: */
42: void handleRow(Object valueObject);
43:
44: }
|