forked from mybatis/mybatis-3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mybatis#442 from mybatis/revert-439-issues/437_pol…
…ishing Revert "mybatis#437: Polishing some logics and comments"
- Loading branch information
Showing
8 changed files
with
10 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -33,7 +31,6 @@ | |
|
||
/** | ||
* @author Guillaume Darmont / [email protected] | ||
* @author Kazuki Shimizu | ||
*/ | ||
public class DefaultCursor<T> implements Cursor<T> { | ||
|
||
|
@@ -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; | ||
|
@@ -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; | ||
} | ||
|
@@ -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) { | ||
|
2 changes: 1 addition & 1 deletion
2
src/test/java/org/apache/ibatis/submitted/cursor_nested/CreateDB.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/test/java/org/apache/ibatis/submitted/cursor_nested/Mapper.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/test/java/org/apache/ibatis/submitted/cursor_nested/mybatis-config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/test/java/org/apache/ibatis/submitted/cursor_simple/CreateDB.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/test/java/org/apache/ibatis/submitted/cursor_simple/Mapper.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/test/java/org/apache/ibatis/submitted/cursor_simple/mybatis-config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters