File tree Expand file tree Collapse file tree 4 files changed +27
-27
lines changed
main/java/org/apache/ibatis/cursor
test/java/org/apache/ibatis/submitted/cursor_simple Expand file tree Collapse file tree 4 files changed +27
-27
lines changed Original file line number Diff line number Diff line change 16
16
package org .apache .ibatis .cursor .defaults ;
17
17
18
18
import org .apache .ibatis .cursor .Cursor ;
19
- import org .apache .ibatis .cursor .CursorException ;
20
19
import org .apache .ibatis .executor .resultset .DefaultResultSetHandler ;
21
20
import org .apache .ibatis .executor .resultset .ResultSetWrapper ;
22
21
import org .apache .ibatis .mapping .ResultMap ;
@@ -45,7 +44,7 @@ public class DefaultCursor<T> implements Cursor<T> {
45
44
private final RowBounds rowBounds ;
46
45
private final ObjectWrapperResultHandler <T > objectWrapperResultHandler = new ObjectWrapperResultHandler <T >();
47
46
48
- private CursorIterator cursorIterator = new CursorIterator ();
47
+ private final CursorIterator cursorIterator = new CursorIterator ();
49
48
private boolean iteratorRetrieved = false ;
50
49
51
50
private CursorStatus status = CursorStatus .CREATED ;
@@ -166,13 +165,13 @@ private int getReadItemsCount() {
166
165
return indexWithRowBound + 1 ;
167
166
}
168
167
169
- private static class ObjectWrapperResultHandler <E > implements ResultHandler <E > {
168
+ private static class ObjectWrapperResultHandler <T > implements ResultHandler <T > {
170
169
171
- private E result ;
170
+ private T result ;
172
171
173
172
@ Override
174
- public void handleResult (ResultContext <? extends E > context ) {
175
- this .result = ( E ) context .getResultObject ();
173
+ public void handleResult (ResultContext <? extends T > context ) {
174
+ this .result = context .getResultObject ();
176
175
context .stop ();
177
176
}
178
177
}
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright 2009-2016 the original author or authors.
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
+ /**
17
+ * Default implementation for cursor feature
18
+ */
19
+ package org .apache .ibatis .cursor .defaults ;
Original file line number Diff line number Diff line change 1
1
/**
2
- * Copyright 2009-2015 the original author or authors.
2
+ * Copyright 2009-2016 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
- package org .apache .ibatis .cursor ;
17
-
18
- import org .apache .ibatis .exceptions .PersistenceException ;
19
-
20
16
/**
21
- * @author Guillaume Darmont / [email protected]
17
+ * Base package for cursor feature
22
18
*/
23
- public class CursorException extends PersistenceException {
24
-
25
- public CursorException (String message ) {
26
- super (message );
27
- }
28
-
29
- public CursorException (String message , Throwable cause ) {
30
- super (message , cause );
31
- }
32
-
33
- public CursorException (Throwable cause ) {
34
- super (cause );
35
- }
36
- }
19
+ package org .apache .ibatis .cursor ;
Original file line number Diff line number Diff line change 16
16
package org .apache .ibatis .submitted .cursor_simple ;
17
17
18
18
import org .apache .ibatis .cursor .Cursor ;
19
- import org .apache .ibatis .cursor .CursorException ;
20
19
import org .apache .ibatis .io .Resources ;
21
20
import org .apache .ibatis .jdbc .ScriptRunner ;
22
21
import org .apache .ibatis .session .RowBounds ;
You can’t perform that action at this time.
0 commit comments