public abstract class AbstractPCResultObjectProvider extends java.lang.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 java.lang.Object |
getObjectId(ClassMetaData meta)
Implement this method to extract the object id value from the
current record of the input.
|
protected abstract java.lang.Class |
getPCType()
Implement this method to extract the type of the pc stored
in the current record of the input.
|
java.lang.Object |
getResultObject()
Instantiate the current result object.
|
void |
handleCheckedException(java.lang.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 java.lang.Exception
PCResultObjectProviderinitialize in interface PCResultObjectProviderjava.lang.ExceptionStoreManager.initialize(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.kernel.PCState, org.apache.openjpa.kernel.FetchConfiguration, java.lang.Object)public java.lang.Object getResultObject()
throws java.lang.Exception
ResultObjectProviderResultObjectProvider.next() or ResultObjectProvider.absolute(int).getResultObject in interface ResultObjectProviderjava.lang.Exceptionprotected abstract java.lang.Object getObjectId(ClassMetaData meta) throws java.lang.Exception
java.lang.Exceptionprotected abstract java.lang.Class getPCType()
throws java.lang.Exception
java.lang.Exceptionprotected abstract void load(OpenJPAStateManager sm, FetchConfiguration fetch) throws java.lang.Exception
OpenJPAStateManager.setVersion(java.lang.Object) to set
the optimistic versioning information, if it has any.java.lang.Exceptionpublic void open()
throws java.lang.Exception
open in interface ResultObjectProviderjava.lang.Exceptionpublic boolean supportsRandomAccess()
supportsRandomAccess in interface ResultObjectProviderResultObjectProvider.supportsRandomAccess()public abstract boolean next()
throws java.lang.Exception
next in interface ResultObjectProviderjava.lang.ExceptionResultObjectProvider.next()public boolean absolute(int pos)
throws java.lang.Exception
absolute in interface ResultObjectProviderjava.lang.ExceptionResultObjectProvider.absolute(int)public int size()
throws java.lang.Exception
Integer.MAX_VALUE by default.size in interface ResultObjectProviderjava.lang.ExceptionResultObjectProvider.size()public void reset()
throws java.lang.Exception
reset in interface ResultObjectProviderjava.lang.ExceptionResultObjectProvider.reset()public void close()
throws java.lang.Exception
close in interface ResultObjectProviderclose in interface Closeablejava.lang.ExceptionResultObjectProvider.close()public void handleCheckedException(java.lang.Exception e)
StoreException by default.handleCheckedException in interface ResultObjectProviderCopyright © 2006-2013 Apache Software Foundation. All Rights Reserved.