Class AbstractFetchDepthFieldManager
- java.lang.Object
-
- org.datanucleus.store.fieldmanager.AbstractFieldManager
-
- org.datanucleus.store.fieldmanager.AbstractFetchDepthFieldManager
-
- All Implemented Interfaces:
FieldConsumer
,FieldManager
,FieldSupplier
- Direct Known Subclasses:
DetachFieldManager
,LoadFieldManager
,MakeTransientFieldManager
public abstract class AbstractFetchDepthFieldManager extends AbstractFieldManager
Base field manager for handling the fetching of fields. Supports a FetchPlan to navigate down an object graph. This is extended by specific managers for the detachment and makeTransient processes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractFetchDepthFieldManager.EndOfFetchPlanGraphException
Exception thrown when we reach the end of the fetch depth in a branch of the object graph
-
Field Summary
Fields Modifier and Type Field Description protected FetchPlanForClass
fpClass
Fetch Plan for the class of this object.protected ObjectProvider
op
ObjectProvider of the instance being fetched (detached or made transient).protected boolean[]
secondClassMutableFields
Second class mutable fields for the class of this object.protected FetchPlanState
state
State for the fetch process.
-
Constructor Summary
Constructors Constructor Description AbstractFetchDepthFieldManager(ObjectProvider op, boolean[] secondClassMutableFields, FetchPlanForClass fpClass, FetchPlanState state)
Constructor for a field manager for fetch plan processing.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Object
endOfGraphOperation(int fieldNumber)
Method called when an end of graph is encountered.boolean
fetchBooleanField(int fieldNumber)
Fetch a boolean field at the specified field number, returning it.byte
fetchByteField(int fieldNumber)
Fetch a byte field at the specified field number, returning it.char
fetchCharField(int fieldNumber)
Fetch a char field at the specified field number, returning it.double
fetchDoubleField(int fieldNumber)
Fetch a double field at the specified field number, returning it.float
fetchFloatField(int fieldNumber)
Fetch a float field at the specified field number, returning it.int
fetchIntField(int fieldNumber)
Fetch an int field at the specified field number, returning it.long
fetchLongField(int fieldNumber)
Fetch a long field at the specified field number, returning it.Object
fetchObjectField(int fieldNumber)
Method to fetch an object field whether it is SCO collection, PC, or whatever.short
fetchShortField(int fieldNumber)
Fetch a short field at the specified field number, returning it.String
fetchStringField(int fieldNumber)
Fetch a string field at the specified field number, returning it.protected abstract Object
internalFetchObjectField(int fieldNumber)
Method to fetch an object field whether it is SCO collection, PC, or whatever.-
Methods inherited from class org.datanucleus.store.fieldmanager.AbstractFieldManager
storeBooleanField, storeByteField, storeCharField, storeDoubleField, storeFloatField, storeIntField, storeLongField, storeObjectField, storeShortField, storeStringField
-
-
-
-
Field Detail
-
op
protected final ObjectProvider op
ObjectProvider of the instance being fetched (detached or made transient).
-
secondClassMutableFields
protected final boolean[] secondClassMutableFields
Second class mutable fields for the class of this object.
-
fpClass
protected final FetchPlanForClass fpClass
Fetch Plan for the class of this object.
-
state
protected final FetchPlanState state
State for the fetch process.
-
-
Constructor Detail
-
AbstractFetchDepthFieldManager
public AbstractFetchDepthFieldManager(ObjectProvider op, boolean[] secondClassMutableFields, FetchPlanForClass fpClass, FetchPlanState state)
Constructor for a field manager for fetch plan processing.- Parameters:
op
- the ObjectProvider of the instance being processed.secondClassMutableFields
- SCO field flagsfpClass
- Fetch Plan for the class of this instancestate
- Object containing the state of the fetch process
-
-
Method Detail
-
fetchObjectField
public Object fetchObjectField(int fieldNumber) throws AbstractFetchDepthFieldManager.EndOfFetchPlanGraphException
Method to fetch an object field whether it is SCO collection, PC, or whatever.- Specified by:
fetchObjectField
in interfaceFieldSupplier
- Overrides:
fetchObjectField
in classAbstractFieldManager
- Parameters:
fieldNumber
- Number of the field- Returns:
- The object
- Throws:
AbstractFetchDepthFieldManager.EndOfFetchPlanGraphException
-
internalFetchObjectField
protected abstract Object internalFetchObjectField(int fieldNumber)
Method to fetch an object field whether it is SCO collection, PC, or whatever.- Parameters:
fieldNumber
- Number of the field- Returns:
- The object
-
endOfGraphOperation
protected abstract Object endOfGraphOperation(int fieldNumber)
Method called when an end of graph is encountered.- Parameters:
fieldNumber
- Number of the field- Returns:
- Object to return
-
fetchBooleanField
public boolean fetchBooleanField(int fieldNumber)
Description copied from interface:FieldSupplier
Fetch a boolean field at the specified field number, returning it.- Specified by:
fetchBooleanField
in interfaceFieldSupplier
- Overrides:
fetchBooleanField
in classAbstractFieldManager
- Parameters:
fieldNumber
- Number of the field- Returns:
- The value
-
fetchByteField
public byte fetchByteField(int fieldNumber)
Description copied from interface:FieldSupplier
Fetch a byte field at the specified field number, returning it.- Specified by:
fetchByteField
in interfaceFieldSupplier
- Overrides:
fetchByteField
in classAbstractFieldManager
- Parameters:
fieldNumber
- Number of the field- Returns:
- The value
-
fetchCharField
public char fetchCharField(int fieldNumber)
Description copied from interface:FieldSupplier
Fetch a char field at the specified field number, returning it.- Specified by:
fetchCharField
in interfaceFieldSupplier
- Overrides:
fetchCharField
in classAbstractFieldManager
- Parameters:
fieldNumber
- Number of the field- Returns:
- The value
-
fetchDoubleField
public double fetchDoubleField(int fieldNumber)
Description copied from interface:FieldSupplier
Fetch a double field at the specified field number, returning it.- Specified by:
fetchDoubleField
in interfaceFieldSupplier
- Overrides:
fetchDoubleField
in classAbstractFieldManager
- Parameters:
fieldNumber
- Number of the field- Returns:
- The value
-
fetchFloatField
public float fetchFloatField(int fieldNumber)
Description copied from interface:FieldSupplier
Fetch a float field at the specified field number, returning it.- Specified by:
fetchFloatField
in interfaceFieldSupplier
- Overrides:
fetchFloatField
in classAbstractFieldManager
- Parameters:
fieldNumber
- Number of the field- Returns:
- The value
-
fetchIntField
public int fetchIntField(int fieldNumber)
Description copied from interface:FieldSupplier
Fetch an int field at the specified field number, returning it.- Specified by:
fetchIntField
in interfaceFieldSupplier
- Overrides:
fetchIntField
in classAbstractFieldManager
- Parameters:
fieldNumber
- Number of the field- Returns:
- The value
-
fetchLongField
public long fetchLongField(int fieldNumber)
Description copied from interface:FieldSupplier
Fetch a long field at the specified field number, returning it.- Specified by:
fetchLongField
in interfaceFieldSupplier
- Overrides:
fetchLongField
in classAbstractFieldManager
- Parameters:
fieldNumber
- Number of the field- Returns:
- The value
-
fetchShortField
public short fetchShortField(int fieldNumber)
Description copied from interface:FieldSupplier
Fetch a short field at the specified field number, returning it.- Specified by:
fetchShortField
in interfaceFieldSupplier
- Overrides:
fetchShortField
in classAbstractFieldManager
- Parameters:
fieldNumber
- Number of the field- Returns:
- The value
-
fetchStringField
public String fetchStringField(int fieldNumber)
Description copied from interface:FieldSupplier
Fetch a string field at the specified field number, returning it.- Specified by:
fetchStringField
in interfaceFieldSupplier
- Overrides:
fetchStringField
in classAbstractFieldManager
- Parameters:
fieldNumber
- Number of the field- Returns:
- The value
-
-