Package org.apache.openjpa.jdbc.kernel
Class XROP
java.lang.Object
org.apache.openjpa.jdbc.kernel.XROP
- All Implemented Interfaces:
BatchedResultObjectProvider
,ResultObjectProvider
,Closeable
Gets multiple Result Object Providers each with different mapping.
- Author:
- Pinaki Poddar
-
Constructor Summary
ConstructorDescriptionXROP
(List<QueryResultMapping> mappings, List<Class<?>> classes, JDBCStore store, JDBCFetchConfiguration fetch, CallableStatement stmt) -
Method Summary
Modifier and TypeMethodDescriptionboolean
absolute
(int pos) Returns false.void
close()
Closes the underlying statement.boolean
Gets the result of executing the underlying JDBC statement.getOut
(int position) Gets the current result set, wraps it with aResultSetResult
, then wraps again with appropriate ROP based on the result set mapping.int
Gets the update count, provided the current result of the statement is not a result set.void
Any checked exceptions that are thrown will be passed to this method.boolean
Affirms if more result sets are available.boolean
next()
Throws exception.void
open()
Opens this provider by executing the underlying Statment.void
reset()
Throws exception.int
size()
Returns-1
.boolean
Does not support random access.
-
Constructor Details
-
XROP
public XROP(List<QueryResultMapping> mappings, List<Class<?>> classes, JDBCStore store, JDBCFetchConfiguration fetch, CallableStatement stmt)
-
-
Method Details
-
supportsRandomAccess
public boolean supportsRandomAccess()Does not support random access.- Specified by:
supportsRandomAccess
in interfaceResultObjectProvider
-
open
Opens this provider by executing the underlying Statment. The result of execution is memorized.- Specified by:
open
in interfaceResultObjectProvider
- Throws:
Exception
-
getResultObject
Gets the current result set, wraps it with aResultSetResult
, then wraps again with appropriate ROP based on the result set mapping.
The ResultSet and the associated connection must not be closed.- Specified by:
getResultObject
in interfaceBatchedResultObjectProvider
- Specified by:
getResultObject
in interfaceResultObjectProvider
- Returns:
- a provider or null if the underlying statement has no more results.
- Throws:
Exception
-
close
Closes the underlying statement.- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceResultObjectProvider
- Throws:
Exception
-
hasMoreResults
public boolean hasMoreResults()Affirms if more result sets are available.
<b.NOTE: The side effect is to advance to the statement's next result.- Specified by:
hasMoreResults
in interfaceBatchedResultObjectProvider
-
getExecutionResult
public boolean getExecutionResult()Description copied from interface:BatchedResultObjectProvider
Gets the result of executing the underlying JDBC statement.- Specified by:
getExecutionResult
in interfaceBatchedResultObjectProvider
- Returns:
- a boolean value whose semantics is same as
PreparedStatement.execute()
.
-
getUpdateCount
public int getUpdateCount()Gets the update count, provided the current result of the statement is not a result set.- Specified by:
getUpdateCount
in interfaceBatchedResultObjectProvider
- Returns:
- an integer value whose semantics is same as
Statement.getUpdateCount()
.
-
getOut
- Specified by:
getOut
in interfaceBatchedResultObjectProvider
-
getOut
- Specified by:
getOut
in interfaceBatchedResultObjectProvider
-
next
Throws exception.- Specified by:
next
in interfaceResultObjectProvider
- Throws:
Exception
-
absolute
Returns false.- Specified by:
absolute
in interfaceResultObjectProvider
- Throws:
Exception
-
size
Returns-1
.- Specified by:
size
in interfaceResultObjectProvider
- Throws:
Exception
-
reset
Throws exception.- Specified by:
reset
in interfaceResultObjectProvider
- Throws:
Exception
-
handleCheckedException
Description copied from interface:ResultObjectProvider
Any checked exceptions that are thrown will be passed to this method. The provider should re-throw the exception as an appropriate unchecked exception.- Specified by:
handleCheckedException
in interfaceResultObjectProvider
-