org.apache.openjpa.jdbc.kernel
Class PagingResultObjectProvider
java.lang.Object
org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider
org.apache.openjpa.jdbc.kernel.PagingResultObjectProvider
- All Implemented Interfaces:
- ResultObjectProvider, Closeable
public class PagingResultObjectProvider
- extends SelectResultObjectProvider
Object provider implementation that fetches one page of results at a
a time as it scrolls. If the getPagedFields(org.apache.openjpa.jdbc.sql.Select, org.apache.openjpa.jdbc.meta.ClassMapping, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration, int, long) method returns a
non-null bit set, this this provider is a good fit for your configuration.
The method tests the following conditions:
- The eager fetch mode is
parallel.
- The select's result should be treated as a large result set.
- The mapping being selected has fields that use parallel selects
under the current fetch configuration.
To use this provider, select the candidate mapping with eager fetch
mode set to join. This provider will take care of performing
parallel mode batch selects for each page it reads.
- Author:
- Abe White
|
Constructor Summary |
PagingResultObjectProvider(SelectExecutor sel,
ClassMapping[] mappings,
JDBCStore store,
JDBCFetchConfiguration fetch,
BitSet[] paged,
long size)
Constructor. |
PagingResultObjectProvider(SelectExecutor sel,
ClassMapping mapping,
JDBCStore store,
JDBCFetchConfiguration fetch,
BitSet paged,
long size)
Constructor. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PagingResultObjectProvider
public PagingResultObjectProvider(SelectExecutor sel,
ClassMapping mapping,
JDBCStore store,
JDBCFetchConfiguration fetch,
BitSet paged,
long size)
- Constructor.
- Parameters:
sel - the select to executemapping - the mapping of the result objectsstore - the store manager to delegate loading tofetch - the fetch configuration, or null for defaultpaged - the bit set returned from getPagedFields(org.apache.openjpa.jdbc.sql.Select, org.apache.openjpa.jdbc.meta.ClassMapping, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration, int, long)size - the known maximum size of the result, or
Long.MAX_VALUE for no known limit
PagingResultObjectProvider
public PagingResultObjectProvider(SelectExecutor sel,
ClassMapping[] mappings,
JDBCStore store,
JDBCFetchConfiguration fetch,
BitSet[] paged,
long size)
- Constructor.
- Parameters:
sel - the select to executemappings - the mappings for the independent classes of the
result objectsstore - the store manager to delegate loading tofetch - the fetch configuration, or null for defaultpaged - the bit sets returned from getPagedFields(org.apache.openjpa.jdbc.sql.Select, org.apache.openjpa.jdbc.meta.ClassMapping, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration, int, long)
for each select in the possible unionsize - the known maximum size of the result, or
Long.MAX_VALUE for no known limit
getPagedFields
public static BitSet getPagedFields(Select sel,
ClassMapping mapping,
JDBCStore store,
JDBCFetchConfiguration fetch,
int eagerMode,
long size)
- Return a bit set representing batch select fields that will be paged,
or null if no fields need paging, which indicates that this provider
should not be used.
- See Also:
PagingResultObjectProvider(org.apache.openjpa.jdbc.sql.SelectExecutor, org.apache.openjpa.jdbc.meta.ClassMapping[], org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration, java.util.BitSet[], long)
getPageSize
public int getPageSize()
- Return the page size in use.
open
public void open()
throws SQLException
- Specified by:
open in interface ResultObjectProvider- Overrides:
open in class SelectResultObjectProvider
- Throws:
SQLException
next
public boolean next()
throws SQLException
- Specified by:
next in interface ResultObjectProvider- Overrides:
next in class SelectResultObjectProvider
- Throws:
SQLException
absolute
public boolean absolute(int pos)
throws SQLException
- Specified by:
absolute in interface ResultObjectProvider- Overrides:
absolute in class SelectResultObjectProvider
- Throws:
SQLException
getResultObject
public Object getResultObject()
throws SQLException
- Throws:
SQLException
Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.