|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.cache.CachedPC
public class CachedPC
An object that is stored in the Level2 Cache keyed by the identity of the persistable object. Comprises a persistable object, its loaded fields array, the version of the persistable object that is stored, and a map of relation field values. The loaded fields and version are used when re-instating the object getting it out of the cache in a consistent state for when it was put in the cache. The relation fields map is used to store the OIDs of any referenced persistable objects. If we have a field "otherObject" that stores a persistable object then we will have an entry keyed by "otherObject" and will contain the OID of the other persistable object. Similarly if we have a field "elements" that is a Collection of persistable objects then we will have an entry keyed by "elements" and will contain a Collection (of the correct instantiation type) containing the OIDs of the element objects. Similarly for Maps, arrays.
| Constructor Summary | |
|---|---|
CachedPC(java.lang.Object pc,
boolean[] loadedFields,
java.lang.Object vers)
Constructor. |
|
| Method Summary | |
|---|---|
boolean[] |
getLoadedFields()
Accessor for the loaded fields of this object |
java.lang.Class |
getPCClass()
Accessor for the class of the persistable object. |
java.lang.Object |
getPersistableObject()
Accessor for the persistable object |
java.lang.Object |
getRelationField(java.lang.String fieldName)
Accessor for the value for the relation field at the field with the specified name. |
java.lang.Object |
getVersion()
Version accessor. |
void |
setLoadedFields(boolean[] flds)
Mutator for the loaded fields. |
void |
setRelationField(java.lang.String fieldName,
java.lang.Object value)
Setter for the value for the relation field with the specified name. |
void |
setVersion(java.lang.Object ver)
Setter for the version. |
java.lang.String |
toString()
Method to return a sting form of the cached object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CachedPC(java.lang.Object pc,
boolean[] loadedFields,
java.lang.Object vers)
pc - The persistable objectloadedFields - The loaded fieldsvers - The version (optional)| Method Detail |
|---|
public java.lang.Object getPersistableObject()
public java.lang.Class getPCClass()
public java.lang.Object getVersion()
public void setVersion(java.lang.Object ver)
ver - New versionpublic boolean[] getLoadedFields()
public void setLoadedFields(boolean[] flds)
flds - The loaded fields
public void setRelationField(java.lang.String fieldName,
java.lang.Object value)
fieldName - Name of fieldvalue - The value. For a field storing a PC object this is an OID. For a Collection field
this is a Collectionpublic java.lang.Object getRelationField(java.lang.String fieldName)
fieldName - Name of field
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||