public abstract class AbstractPCResultObjectProvider extends Object implements PCResultObjectProvider
PCResultObjectProvider
that implements ResultObjectProvider.getResultObject()
by assembling the necessary information about the object to be loaded.| Modifier and Type | Field and Description |
|---|---|
protected StoreContext |
ctx
The
StoreContext that this result object
provider will load objects into. |
| Constructor and Description |
|---|
AbstractPCResultObjectProvider(StoreContext ctx)
Create a new provider for loading PC objects from the input
into
ctx. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
absolute(int pos)
Override if desired.
|
void |
close()
Override if desired.
|
StoreContext |
getContext()
Return the context this provider was constructed with.
|
protected abstract Object |
getObjectId(ClassMetaData meta)
Implement this method to extract the object id value from the
current record of the input.
|
protected abstract Class |
getPCType()
Implement this method to extract the type of the pc stored
in the current record of the input.
|
Object |
getResultObject()
Instantiate the current result object.
|
void |
handleCheckedException(Exception e)
Throws a
StoreException by default. |
void |
initialize(OpenJPAStateManager sm,
PCState state,
FetchConfiguration fetch)
Initializes the state manager.
|
protected abstract void |
load(OpenJPAStateManager sm,
FetchConfiguration fetch)
Load data from the current input record into the given state
manager.
|
abstract boolean |
next()
Implement this method to advance the input.
|
void |
open()
Override if desired.
|
void |
reset()
Override if desired.
|
int |
size()
Override if desired.
|
boolean |
supportsRandomAccess()
Override if desired.
|
protected final StoreContext ctx
StoreContext that this result object
provider will load objects into.public AbstractPCResultObjectProvider(StoreContext ctx)
ctx.public StoreContext getContext()
public void initialize(OpenJPAStateManager sm, PCState state, FetchConfiguration fetch) throws Exception
PCResultObjectProviderpublic Object getResultObject() throws Exception
ResultObjectProviderResultObjectProvider.next() or ResultObjectProvider.absolute(int).getResultObject in interface ResultObjectProviderExceptionprotected abstract Object getObjectId(ClassMetaData meta) throws Exception
Exceptionprotected abstract Class getPCType() throws Exception
Exceptionprotected abstract void load(OpenJPAStateManager sm, FetchConfiguration fetch) throws Exception
OpenJPAStateManager.setVersion(java.lang.Object) to set
the optimistic versioning information, if it has any.Exceptionpublic void open()
throws Exception
open in interface ResultObjectProviderExceptionpublic boolean supportsRandomAccess()
supportsRandomAccess in interface ResultObjectProviderResultObjectProvider.supportsRandomAccess()public abstract boolean next()
throws Exception
next in interface ResultObjectProviderExceptionResultObjectProvider.next()public boolean absolute(int pos)
throws Exception
absolute in interface ResultObjectProviderExceptionResultObjectProvider.absolute(int)public int size()
throws Exception
Integer.MAX_VALUE by default.size in interface ResultObjectProviderExceptionResultObjectProvider.size()public void reset()
throws Exception
reset in interface ResultObjectProviderExceptionResultObjectProvider.reset()public void close()
throws Exception
close in interface ResultObjectProviderclose in interface CloseableExceptionResultObjectProvider.close()public void handleCheckedException(Exception e)
StoreException by default.handleCheckedException in interface ResultObjectProviderCopyright © 2006–2022 Apache Software Foundation. All rights reserved.