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
ConstructorsConstructorDescriptionXROP(List<QueryResultMapping> mappings, List<Class<?>> classes, JDBCStore store, JDBCFetchConfiguration fetch, CallableStatement stmt) -
Method Summary
Modifier and TypeMethodDescriptionbooleanabsolute(int pos) Returns false.voidclose()Closes the underlying statement.booleanGets 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.intGets the update count, provided the current result of the statement is not a result set.voidAny checked exceptions that are thrown will be passed to this method.booleanAffirms if more result sets are available.booleannext()Throws exception.voidopen()Opens this provider by executing the underlying Statment.voidreset()Throws exception.intsize()Returns-1.booleanDoes 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:
supportsRandomAccessin interfaceResultObjectProvider
-
open
Opens this provider by executing the underlying Statment. The result of execution is memorized.- Specified by:
openin 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:
getResultObjectin interfaceBatchedResultObjectProvider- Specified by:
getResultObjectin interfaceResultObjectProvider- Returns:
- a provider or null if the underlying statement has no more results.
- Throws:
Exception
-
close
Closes the underlying statement.- Specified by:
closein interfaceCloseable- Specified by:
closein 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:
hasMoreResultsin interfaceBatchedResultObjectProvider
-
getExecutionResult
public boolean getExecutionResult()Description copied from interface:BatchedResultObjectProviderGets the result of executing the underlying JDBC statement.- Specified by:
getExecutionResultin 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:
getUpdateCountin interfaceBatchedResultObjectProvider- Returns:
- an integer value whose semantics is same as
Statement.getUpdateCount().
-
getOut
- Specified by:
getOutin interfaceBatchedResultObjectProvider
-
getOut
- Specified by:
getOutin interfaceBatchedResultObjectProvider
-
next
Throws exception.- Specified by:
nextin interfaceResultObjectProvider- Throws:
Exception
-
absolute
Returns false.- Specified by:
absolutein interfaceResultObjectProvider- Throws:
Exception
-
size
Returns-1.- Specified by:
sizein interfaceResultObjectProvider- Throws:
Exception
-
reset
Throws exception.- Specified by:
resetin interfaceResultObjectProvider- Throws:
Exception
-
handleCheckedException
Description copied from interface:ResultObjectProviderAny 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:
handleCheckedExceptionin interfaceResultObjectProvider
-