Package org.apache.openjpa.kernel
Class AbstractPCResultObjectProvider
- java.lang.Object
- 
- org.apache.openjpa.kernel.AbstractPCResultObjectProvider
 
- 
- All Implemented Interfaces:
- PCResultObjectProvider,- ResultObjectProvider,- Closeable
 
 public abstract class AbstractPCResultObjectProvider extends java.lang.Object implements PCResultObjectProvider Abstract implementation ofPCResultObjectProviderthat implementsResultObjectProvider.getResultObject()by assembling the necessary information about the object to be loaded.- Author:
- Patrick Linskey
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected StoreContextctxTheStoreContextthat this result object provider will load objects into.
 - 
Constructor SummaryConstructors Constructor Description AbstractPCResultObjectProvider(StoreContext ctx)Create a new provider for loading PC objects from the input intoctx.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanabsolute(int pos)Override if desired.voidclose()Override if desired.StoreContextgetContext()Return the context this provider was constructed with.protected abstract java.lang.ObjectgetObjectId(ClassMetaData meta)Implement this method to extract the object id value from the current record of the input.protected abstract java.lang.ClassgetPCType()Implement this method to extract the type of the pc stored in the current record of the input.java.lang.ObjectgetResultObject()Instantiate the current result object.voidhandleCheckedException(java.lang.Exception e)Throws aStoreExceptionby default.voidinitialize(OpenJPAStateManager sm, PCState state, FetchConfiguration fetch)Initializes the state manager.protected abstract voidload(OpenJPAStateManager sm, FetchConfiguration fetch)Load data from the current input record into the given state manager.abstract booleannext()Implement this method to advance the input.voidopen()Override if desired.voidreset()Override if desired.intsize()Override if desired.booleansupportsRandomAccess()Override if desired.
 
- 
- 
- 
Field Detail- 
ctxprotected final StoreContext ctx TheStoreContextthat this result object provider will load objects into.
 
- 
 - 
Constructor Detail- 
AbstractPCResultObjectProviderpublic AbstractPCResultObjectProvider(StoreContext ctx) Create a new provider for loading PC objects from the input intoctx.
 
- 
 - 
Method Detail- 
getContextpublic StoreContext getContext() Return the context this provider was constructed with.
 - 
initializepublic void initialize(OpenJPAStateManager sm, PCState state, FetchConfiguration fetch) throws java.lang.Exception Description copied from interface:PCResultObjectProviderInitializes the state manager.- Specified by:
- initializein interface- PCResultObjectProvider
- Throws:
- java.lang.Exception
- See Also:
- StoreManager.initialize(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.kernel.PCState, org.apache.openjpa.kernel.FetchConfiguration, java.lang.Object)
 
 - 
getResultObjectpublic java.lang.Object getResultObject() throws java.lang.ExceptionDescription copied from interface:ResultObjectProviderInstantiate the current result object. This method will only be called afterResultObjectProvider.next()orResultObjectProvider.absolute(int).- Specified by:
- getResultObjectin interface- ResultObjectProvider
- Throws:
- java.lang.Exception
 
 - 
getObjectIdprotected abstract java.lang.Object getObjectId(ClassMetaData meta) throws java.lang.Exception Implement this method to extract the object id value from the current record of the input.- Throws:
- java.lang.Exception
 
 - 
getPCTypeprotected abstract java.lang.Class getPCType() throws java.lang.ExceptionImplement this method to extract the type of the pc stored in the current record of the input.- Throws:
- java.lang.Exception
 
 - 
loadprotected abstract void load(OpenJPAStateManager sm, FetchConfiguration fetch) throws java.lang.Exception Load data from the current input record into the given state manager. Remember to callOpenJPAStateManager.setVersion(java.lang.Object)to set the optimistic versioning information, if it has any.- Throws:
- java.lang.Exception
 
 - 
openpublic void open() throws java.lang.ExceptionOverride if desired. Does nothing by default.- Specified by:
- openin interface- ResultObjectProvider
- Throws:
- java.lang.Exception
 
 - 
supportsRandomAccesspublic boolean supportsRandomAccess() Override if desired. Returns false by default.- Specified by:
- supportsRandomAccessin interface- ResultObjectProvider
- See Also:
- ResultObjectProvider.supportsRandomAccess()
 
 - 
nextpublic abstract boolean next() throws java.lang.ExceptionImplement this method to advance the input.- Specified by:
- nextin interface- ResultObjectProvider
- Throws:
- java.lang.Exception
- See Also:
- ResultObjectProvider.next()
 
 - 
absolutepublic boolean absolute(int pos) throws java.lang.ExceptionOverride if desired. Throws an exception by default.- Specified by:
- absolutein interface- ResultObjectProvider
- Throws:
- java.lang.Exception
- See Also:
- ResultObjectProvider.absolute(int)
 
 - 
sizepublic int size() throws java.lang.ExceptionOverride if desired. ReturnsInteger.MAX_VALUEby default.- Specified by:
- sizein interface- ResultObjectProvider
- Throws:
- java.lang.Exception
- See Also:
- ResultObjectProvider.size()
 
 - 
resetpublic void reset() throws java.lang.ExceptionOverride if desired. Throws an exception by default.- Specified by:
- resetin interface- ResultObjectProvider
- Throws:
- java.lang.Exception
- See Also:
- ResultObjectProvider.reset()
 
 - 
closepublic void close() throws java.lang.ExceptionOverride if desired. Does nothing by default.- Specified by:
- closein interface- Closeable
- Specified by:
- closein interface- ResultObjectProvider
- Throws:
- java.lang.Exception
- See Also:
- ResultObjectProvider.close()
 
 - 
handleCheckedExceptionpublic void handleCheckedException(java.lang.Exception e) Throws aStoreExceptionby default.- Specified by:
- handleCheckedExceptionin interface- ResultObjectProvider
 
 
- 
 
-