|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.kernel.AbstractPCResultObjectProvider
public abstract class AbstractPCResultObjectProvider
Abstract implementation of PCResultObjectProvider
that implements ResultObjectProvider.getResultObject()
by assembling the necessary information about the object to be loaded.
Field Summary | |
---|---|
protected StoreContext |
ctx
The StoreContext that this result object
provider will load objects into. |
Constructor Summary | |
---|---|
AbstractPCResultObjectProvider(StoreContext ctx)
Create a new provider for loading PC objects from the input into ctx . |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final StoreContext ctx
StoreContext
that this result object
provider will load objects into.
Constructor Detail |
---|
public AbstractPCResultObjectProvider(StoreContext ctx)
ctx
.
Method Detail |
---|
public StoreContext getContext()
public void initialize(OpenJPAStateManager sm, PCState state, FetchConfiguration fetch) throws Exception
PCResultObjectProvider
initialize
in interface PCResultObjectProvider
Exception
StoreManager.initialize(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.kernel.PCState, org.apache.openjpa.kernel.FetchConfiguration, java.lang.Object)
public Object getResultObject() throws Exception
ResultObjectProvider
ResultObjectProvider.next()
or ResultObjectProvider.absolute(int)
.
getResultObject
in interface ResultObjectProvider
Exception
protected abstract Object getObjectId(ClassMetaData meta) throws Exception
Exception
protected abstract Class getPCType() throws Exception
Exception
protected abstract void load(OpenJPAStateManager sm, FetchConfiguration fetch) throws Exception
OpenJPAStateManager.setVersion(java.lang.Object)
to set
the optimistic versioning information, if it has any.
Exception
public void open() throws Exception
open
in interface ResultObjectProvider
Exception
public boolean supportsRandomAccess()
supportsRandomAccess
in interface ResultObjectProvider
ResultObjectProvider.supportsRandomAccess()
public abstract boolean next() throws Exception
next
in interface ResultObjectProvider
Exception
ResultObjectProvider.next()
public boolean absolute(int pos) throws Exception
absolute
in interface ResultObjectProvider
Exception
ResultObjectProvider.absolute(int)
public int size() throws Exception
Integer.MAX_VALUE
by default.
size
in interface ResultObjectProvider
Exception
ResultObjectProvider.size()
public void reset() throws Exception
reset
in interface ResultObjectProvider
Exception
ResultObjectProvider.reset()
public void close() throws Exception
close
in interface ResultObjectProvider
close
in interface Closeable
Exception
ResultObjectProvider.close()
public void handleCheckedException(Exception e)
StoreException
by default.
handleCheckedException
in interface ResultObjectProvider
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |