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 Object
implements PCResultObjectProvider
Abstract implementation of
PCResultObjectProvider
that implements ResultObjectProvider.getResultObject()
by assembling the necessary information about the object to be loaded.- Author:
- Patrick Linskey
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StoreContextTheStoreContextthat this result object provider will load objects into. -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new provider for loading PC objects from the input intoctx. -
Method Summary
Modifier and TypeMethodDescriptionbooleanabsolute(int pos) Override if desired.voidclose()Override if desired.Return the context this provider was constructed with.protected abstract ObjectgetObjectId(ClassMetaData meta) Implement this method to extract the object id value from the current record of the input.protected abstract ClassImplement this method to extract the type of the pc stored in the current record of the input.Instantiate the current result object.voidThrows 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.booleanOverride if desired.
-
Field Details
-
ctx
TheStoreContextthat this result object provider will load objects into.
-
-
Constructor Details
-
AbstractPCResultObjectProvider
Create a new provider for loading PC objects from the input intoctx.
-
-
Method Details
-
getContext
Return the context this provider was constructed with. -
initialize
public void initialize(OpenJPAStateManager sm, PCState state, FetchConfiguration fetch) throws Exception Description copied from interface:PCResultObjectProviderInitializes the state manager. -
getResultObject
Description copied from interface:ResultObjectProviderInstantiate the current result object. This method will only be called afterResultObjectProvider.next()orResultObjectProvider.absolute(int).- Specified by:
getResultObjectin interfaceResultObjectProvider- Throws:
Exception
-
getObjectId
Implement this method to extract the object id value from the current record of the input.- Throws:
Exception
-
getPCType
Implement this method to extract the type of the pc stored in the current record of the input.- Throws:
Exception
-
load
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:
Exception
-
open
Override if desired. Does nothing by default.- Specified by:
openin interfaceResultObjectProvider- Throws:
Exception
-
supportsRandomAccess
public boolean supportsRandomAccess()Override if desired. Returns false by default.- Specified by:
supportsRandomAccessin interfaceResultObjectProvider- See Also:
-
next
Implement this method to advance the input.- Specified by:
nextin interfaceResultObjectProvider- Throws:
Exception- See Also:
-
absolute
Override if desired. Throws an exception by default.- Specified by:
absolutein interfaceResultObjectProvider- Throws:
Exception- See Also:
-
size
Override if desired. ReturnsInteger.MAX_VALUEby default.- Specified by:
sizein interfaceResultObjectProvider- Throws:
Exception- See Also:
-
reset
Override if desired. Throws an exception by default.- Specified by:
resetin interfaceResultObjectProvider- Throws:
Exception- See Also:
-
close
Override if desired. Does nothing by default.- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceResultObjectProvider- Throws:
Exception- See Also:
-
handleCheckedException
Throws aStoreExceptionby default.- Specified by:
handleCheckedExceptionin interfaceResultObjectProvider
-