Package org.apache.openjpa.jdbc.kernel
Class XROP
- java.lang.Object
-
- org.apache.openjpa.jdbc.kernel.XROP
-
- All Implemented Interfaces:
BatchedResultObjectProvider,ResultObjectProvider,Closeable
public class XROP extends Object implements BatchedResultObjectProvider
Gets multiple Result Object Providers each with different mapping.- Author:
- Pinaki Poddar
-
-
Constructor Summary
Constructors Constructor Description XROP(List<QueryResultMapping> mappings, List<Class<?>> classes, JDBCStore store, JDBCFetchConfiguration fetch, CallableStatement stmt)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanabsolute(int pos)Returns false.voidclose()Closes the underlying statement.booleangetExecutionResult()Gets the result of executing the underlying JDBC statement.ObjectgetOut(int position)ObjectgetOut(String name)ResultObjectProvidergetResultObject()Gets the current result set, wraps it with aResultSetResult, then wraps again with appropriate ROP based on the result set mapping.intgetUpdateCount()Gets the update count, provided the current result of the statement is not a result set.voidhandleCheckedException(Exception e)Any checked exceptions that are thrown will be passed to this method.booleanhasMoreResults()Affirms if more result sets are available.booleannext()Throws exception.voidopen()Opens this provider by executing the underlying Statment.voidreset()Throws exception.intsize()Returns-1.booleansupportsRandomAccess()Does not support random access.
-
-
-
Constructor Detail
-
XROP
public XROP(List<QueryResultMapping> mappings, List<Class<?>> classes, JDBCStore store, JDBCFetchConfiguration fetch, CallableStatement stmt)
-
-
Method Detail
-
supportsRandomAccess
public boolean supportsRandomAccess()
Does not support random access.- Specified by:
supportsRandomAccessin interfaceResultObjectProvider
-
open
public void open() throws ExceptionOpens this provider by executing the underlying Statment. The result of execution is memorized.- Specified by:
openin interfaceResultObjectProvider- Throws:
Exception
-
getResultObject
public ResultObjectProvider getResultObject() throws Exception
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
public void close() throws ExceptionCloses the underlying statement.- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceResultObjectProvider- Throws:
Exception
-
hasMoreResults
public boolean hasMoreResults()
Affirms if more result sets are available.
: 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
public Object getOut(String name)
- Specified by:
getOutin interfaceBatchedResultObjectProvider
-
getOut
public Object getOut(int position)
- Specified by:
getOutin interfaceBatchedResultObjectProvider
-
next
public boolean next() throws ExceptionThrows exception.- Specified by:
nextin interfaceResultObjectProvider- Throws:
Exception
-
absolute
public boolean absolute(int pos) throws ExceptionReturns false.- Specified by:
absolutein interfaceResultObjectProvider- Throws:
Exception
-
size
public int size() throws ExceptionReturns-1.- Specified by:
sizein interfaceResultObjectProvider- Throws:
Exception
-
reset
public void reset() throws ExceptionThrows exception.- Specified by:
resetin interfaceResultObjectProvider- Throws:
Exception
-
handleCheckedException
public void handleCheckedException(Exception e)
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
-
-