Package org.apache.openjpa.datacache
Class DataCachePCDataImpl
java.lang.Object
org.apache.openjpa.kernel.AbstractPCData
org.apache.openjpa.kernel.PCDataImpl
org.apache.openjpa.datacache.DataCachePCDataImpl
- All Implemented Interfaces:
Serializable,DataCachePCData,PCData
Specialized
PCData implementation for data caching. This
implementation is properly synchronized.- Author:
- Patrick Linskey
- See Also:
-
Field Summary
Fields inherited from class org.apache.openjpa.kernel.AbstractPCData
NULL -
Constructor Summary
ConstructorsConstructorDescriptionDataCachePCDataImpl(Object oid, ClassMetaData meta) DataCachePCDataImpl(Object oid, ClassMetaData meta, String name) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidclearData(int index) protected voidCheck if this field is in use of "order by" by other field collections in inverse relation.getData(int index) Return the data stored in the given field index.Returns the instance-level impl data, or null if none.getImplData(int index) getIntermediate(int index) longGets the original timeout of this instance.Returns the current version object that this data was loaded from.booleanisLoaded(int index) Whether the given field index has stored data.booleanWhether this data is timed out.Return a newPCDataimplementation of the right type for embedded instances.voidvoidsetImplData(int index, Object val) voidsetImplData(Object val) Sets the stored instance-level impl data.voidsetIntermediate(int index, Object val) voidsetLoaded(int index, boolean loaded) voidsetVersion(Object version) Sets the current version object that this data was loaded from.voidStore all loaded fields of the state manager.voidstore(OpenJPAStateManager sm, BitSet fields) Store the given fields from the state manager.protected voidstoreField(OpenJPAStateManager sm, FieldMetaData fmd) Store field-level information from the given state manager.protected ObjecttoData(FieldMetaData fmd, Object val, StoreContext ctx) Transform the given field value to a data value for caching.protected ObjecttoNestedData(ValueMetaData vmd, Object val, StoreContext ctx) Transform the given nested value to a cachable value.Methods inherited from class org.apache.openjpa.kernel.PCDataImpl
getCache, getId, getLoaded, getType, load, load, loadField, loadImplData, loadImplData, loadIntermediate, loadVersion, storeImplData, storeImplData, storeIntermediate, storeVersionMethods inherited from class org.apache.openjpa.kernel.AbstractPCData
toEmbeddedData, toEmbeddedField, toField, toNestedField, toNestedFields, toRelationData, toRelationField, toRelationFields
-
Constructor Details
-
DataCachePCDataImpl
-
DataCachePCDataImpl
Constructor.
-
-
Method Details
-
isTimedOut
public boolean isTimedOut()Description copied from interface:DataCachePCDataWhether this data is timed out.- Specified by:
isTimedOutin interfaceDataCachePCData
-
getTimeOut
public long getTimeOut()Description copied from interface:DataCachePCDataGets the original timeout of this instance.- Specified by:
getTimeOutin interfaceDataCachePCData- Returns:
- -1 for no timeout ever.
-
getData
Description copied from interface:PCDataReturn the data stored in the given field index.- Specified by:
getDatain interfacePCData- Overrides:
getDatain classPCDataImpl
-
setData
- Overrides:
setDatain classPCDataImpl
-
clearData
public void clearData(int index) - Overrides:
clearDatain classPCDataImpl
-
getImplData
Description copied from interface:PCDataReturns the instance-level impl data, or null if none.- Specified by:
getImplDatain interfacePCData- Overrides:
getImplDatain classPCDataImpl
-
setImplData
Description copied from interface:PCDataSets the stored instance-level impl data.- Specified by:
setImplDatain interfacePCData- Overrides:
setImplDatain classPCDataImpl
-
getImplData
- Overrides:
getImplDatain classPCDataImpl
-
setImplData
- Overrides:
setImplDatain classPCDataImpl
-
getIntermediate
- Overrides:
getIntermediatein classPCDataImpl
-
setIntermediate
- Overrides:
setIntermediatein classPCDataImpl
-
isLoaded
public boolean isLoaded(int index) Description copied from interface:PCDataWhether the given field index has stored data.- Specified by:
isLoadedin interfacePCData- Overrides:
isLoadedin classPCDataImpl
-
setLoaded
public void setLoaded(int index, boolean loaded) - Overrides:
setLoadedin classPCDataImpl
-
getVersion
Description copied from interface:PCDataReturns the current version object that this data was loaded from.- Specified by:
getVersionin interfacePCData- Overrides:
getVersionin classPCDataImpl
-
setVersion
Description copied from interface:PCDataSets the current version object that this data was loaded from.- Specified by:
setVersionin interfacePCData- Overrides:
setVersionin classPCDataImpl
-
store
Description copied from interface:PCDataStore all loaded fields of the state manager.- Specified by:
storein interfacePCData- Overrides:
storein classPCDataImpl
-
store
Description copied from interface:PCDataStore the given fields from the state manager.- Specified by:
storein interfacePCData- Overrides:
storein classPCDataImpl
-
storeField
Store field-level information from the given state manager. Special process of checking if the cached collection data is out of order.- Overrides:
storeFieldin classPCDataImpl
-
clearInverseRelationCache
Check if this field is in use of "order by" by other field collections in inverse relation. If it is, clear the other field cache because it could be out of order. -
toData
Description copied from class:AbstractPCDataTransform the given field value to a data value for caching. ReturnAbstractPCData.NULLif unable to cache.- Overrides:
toDatain classAbstractPCData
-
toNestedData
Description copied from class:AbstractPCDataTransform the given nested value to a cachable value. ReturnAbstractPCData.NULLif the value cannot be cached.- Overrides:
toNestedDatain classAbstractPCData
-
newEmbeddedPCData
Description copied from class:PCDataImplReturn a newPCDataimplementation of the right type for embedded instances. Returns aPCDataImplby default.- Overrides:
newEmbeddedPCDatain classPCDataImpl
-