Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/main/java/org/apache/ibatis/binding/MapperMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
* @author Clinton Begin
* @author Eduardo Macarron
* @author Lasse Voss
* @author Kazuki Shimizu
*/
public class MapperMethod {

Expand Down Expand Up @@ -246,7 +245,7 @@ public MethodSignature(Configuration configuration, Method method) {
this.returnType = method.getReturnType();
this.returnsVoid = void.class.equals(this.returnType);
this.returnsMany = (configuration.getObjectFactory().isCollection(this.returnType) || this.returnType.isArray());
this.returnsCursor = Cursor.class.isAssignableFrom(this.returnType);
this.returnsCursor = Cursor.class.equals(this.returnType);
this.mapKey = getMapKey(method);
this.returnsMap = (this.mapKey != null);
this.hasNamedParameters = hasNamedParams(method);
Expand Down
17 changes: 3 additions & 14 deletions src/main/java/org/apache/ibatis/cursor/defaults/DefaultCursor.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
package org.apache.ibatis.cursor.defaults;

import org.apache.ibatis.cursor.Cursor;
import org.apache.ibatis.exceptions.ExceptionFactory;
import org.apache.ibatis.executor.ErrorContext;
import org.apache.ibatis.executor.resultset.DefaultResultSetHandler;
import org.apache.ibatis.executor.resultset.ResultSetWrapper;
import org.apache.ibatis.mapping.ResultMap;
Expand All @@ -33,7 +31,6 @@

/**
* @author Guillaume Darmont / guillaume@dropinocean.com
* @author Kazuki Shimizu
*/
public class DefaultCursor<T> implements Cursor<T> {

Expand Down Expand Up @@ -114,7 +111,7 @@ protected T fetchNextObjectFromDatabase() {
opened = true;
resultSetHandler.handleRowValues(rsw, resultMap, objectWrapperResultHandler, RowBounds.DEFAULT, null);
} catch (SQLException e) {
ExceptionFactory.wrapException("Error fetching next object from database at the DefaultCursor.", e);
throw new RuntimeException(e);
}

T next = objectWrapperResultHandler.result;
Expand Down Expand Up @@ -163,11 +160,7 @@ public CursorIterator() {
@Override
public boolean hasNext() {
if (object == null) {
try {
object = fetchNextUsingRowBound();
} finally {
ErrorContext.instance().reset();
}
object = fetchNextUsingRowBound();
}
return object != null;
}
Expand All @@ -178,11 +171,7 @@ public T next() {
T next = object;

if (next == null) {
try {
next = fetchNextUsingRowBound();
} finally {
ErrorContext.instance().reset();
}
next = fetchNextUsingRowBound();
}

if (next != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

--
-- Copyright 2009-2015 The MyBatis Team
-- Copyright 2009-2012 The MyBatis Team
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2009-2015 The MyBatis Team
Copyright 2009-2012 The MyBatis Team

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright 2009-2015 The MyBatis Team
Copyright 2009-2012 The MyBatis Team

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--
-- Copyright 2009-2015 The MyBatis Team
-- Copyright 2009-2012 The MyBatis Team
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2009-2015 The MyBatis Team
Copyright 2009-2012 The MyBatis Team

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright 2009-2015 The MyBatis Team
Copyright 2009-2012 The MyBatis Team

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down