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
PCResultObjectProvider
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
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.