org.apache.openjpa.kernel
Class PCDataImpl

java.lang.Object
  extended by org.apache.openjpa.kernel.AbstractPCData
      extended by org.apache.openjpa.kernel.PCDataImpl
All Implemented Interfaces:
Serializable, PCData
Direct Known Subclasses:
DataCachePCDataImpl

public class PCDataImpl
extends AbstractPCData

Default PCData implementation.

Author:
Patrick Linskey, Abe White
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.openjpa.kernel.AbstractPCData
NULL
 
Constructor Summary
PCDataImpl(Object oid, ClassMetaData meta)
           
PCDataImpl(Object oid, ClassMetaData meta, String name)
          Constructor.
 
Method Summary
 void clearData(int index)
           
 String getCache()
          Get the name of the cache where this data is stored.
 Object getData(int index)
          Return the data stored in the given field index.
 Object getId()
          Return the id of this instance.
 Object getImplData()
          Returns the instance-level impl data, or null if none.
 Object getImplData(int index)
           
 Object getIntermediate(int index)
           
 BitSet getLoaded()
          Return the loaded field mask.
 Class<?> getType()
          Return the type of this instance.
 Object getVersion()
          Returns the current version object that this data was loaded from.
 boolean isLoaded(int index)
          Whether the given field index has stored data.
 void load(OpenJPAStateManager sm, BitSet fields, FetchConfiguration fetch, Object context)
          Loads some or all of the marked fields from the cache into the given state manager.
 void load(OpenJPAStateManager sm, FetchConfiguration fetch, Object context)
          Loads all fields that are currently stored in the cache into the given state manager.
protected  void loadField(OpenJPAStateManager sm, FieldMetaData fmd, FetchConfiguration fetch, Object context)
          Set field-level information into the given state manager.
protected  void loadImplData(OpenJPAStateManager sm)
          Set impl data information into the given state manager.
protected  void loadImplData(OpenJPAStateManager sm, FieldMetaData fmd)
          Set field-level impl data into the given state manager.
protected  void loadIntermediate(OpenJPAStateManager sm, FieldMetaData fmd)
          Set intermediate information for the given field into the state manager.
protected  void loadVersion(OpenJPAStateManager sm)
          Set version information into the given state manager.
 AbstractPCData newEmbeddedPCData(OpenJPAStateManager sm)
          Return a new PCData implementation of the right type for embedded instances.
 void setData(int index, Object val)
           
 void setImplData(int index, Object val)
           
 void setImplData(Object val)
          Sets the stored instance-level impl data.
 void setIntermediate(int index, Object val)
           
 void setLoaded(int index, boolean loaded)
           
 void setVersion(Object version)
          Sets the current version object that this data was loaded from.
 void store(OpenJPAStateManager sm)
          Store all loaded fields of the state manager.
 void store(OpenJPAStateManager sm, BitSet fields)
          Store the given fields from the state manager.
protected  void storeField(OpenJPAStateManager sm, FieldMetaData fmd)
          Store field-level information from the given state manager.
protected  void storeImplData(OpenJPAStateManager sm)
          Store impl data from the given state manager.
protected  void storeImplData(OpenJPAStateManager sm, FieldMetaData fmd, boolean fieldLoaded)
          Store impl data for the given field.
protected  void storeIntermediate(OpenJPAStateManager sm, FieldMetaData fmd)
          Store the intermediate field value for the given field.
protected  void storeVersion(OpenJPAStateManager sm)
          Store version information from the given state manager.
 
Methods inherited from class org.apache.openjpa.kernel.AbstractPCData
toData, toEmbeddedData, toEmbeddedField, toField, toNestedData, toNestedField, toNestedFields, toRelationData, toRelationField, toRelationFields
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PCDataImpl

public PCDataImpl(Object oid,
                  ClassMetaData meta)

PCDataImpl

public PCDataImpl(Object oid,
                  ClassMetaData meta,
                  String name)
Constructor.

Method Detail

getId

public Object getId()
Description copied from interface: PCData
Return the id of this instance.


getType

public Class<?> getType()
Description copied from interface: PCData
Return the type of this instance.


getLoaded

public BitSet getLoaded()
Description copied from class: AbstractPCData
Return the loaded field mask.

Specified by:
getLoaded in class AbstractPCData

getData

public Object getData(int index)
Description copied from interface: PCData
Return the data stored in the given field index.


setData

public void setData(int index,
                    Object val)

clearData

public void clearData(int index)

getImplData

public Object getImplData()
Description copied from interface: PCData
Returns the instance-level impl data, or null if none.


setImplData

public void setImplData(Object val)
Description copied from interface: PCData
Sets the stored instance-level impl data.


getImplData

public Object getImplData(int index)

setImplData

public void setImplData(int index,
                        Object val)

getIntermediate

public Object getIntermediate(int index)

setIntermediate

public void setIntermediate(int index,
                            Object val)

isLoaded

public boolean isLoaded(int index)
Description copied from interface: PCData
Whether the given field index has stored data.

Specified by:
isLoaded in interface PCData
Overrides:
isLoaded in class AbstractPCData

setLoaded

public void setLoaded(int index,
                      boolean loaded)

getVersion

public Object getVersion()
Description copied from interface: PCData
Returns the current version object that this data was loaded from.


setVersion

public void setVersion(Object version)
Description copied from interface: PCData
Sets the current version object that this data was loaded from.


load

public void load(OpenJPAStateManager sm,
                 FetchConfiguration fetch,
                 Object context)
Description copied from interface: PCData
Loads all fields that are currently stored in the cache into the given state manager.

Parameters:
sm - the state manager to load
fetch - the fetch configuration to use for loading related objects
context - current context information

load

public void load(OpenJPAStateManager sm,
                 BitSet fields,
                 FetchConfiguration fetch,
                 Object context)
Description copied from interface: PCData
Loads some or all of the marked fields from the cache into the given state manager.

Parameters:
sm - the state manager to load
fields - the fields to load; clear the bits for the fields that are successfully loaded
fetch - the fetch configuration to use for loading related objects
context - current context information

loadVersion

protected void loadVersion(OpenJPAStateManager sm)
Set version information into the given state manager.


loadImplData

protected void loadImplData(OpenJPAStateManager sm)
Set impl data information into the given state manager.


loadField

protected void loadField(OpenJPAStateManager sm,
                         FieldMetaData fmd,
                         FetchConfiguration fetch,
                         Object context)
Set field-level information into the given state manager.


loadImplData

protected void loadImplData(OpenJPAStateManager sm,
                            FieldMetaData fmd)
Set field-level impl data into the given state manager.


loadIntermediate

protected void loadIntermediate(OpenJPAStateManager sm,
                                FieldMetaData fmd)
Set intermediate information for the given field into the state manager.


store

public void store(OpenJPAStateManager sm)
Description copied from interface: PCData
Store all loaded fields of the state manager.


store

public void store(OpenJPAStateManager sm,
                  BitSet fields)
Description copied from interface: PCData
Store the given fields from the state manager.


storeVersion

protected void storeVersion(OpenJPAStateManager sm)
Store version information from the given state manager.


storeImplData

protected void storeImplData(OpenJPAStateManager sm)
Store impl data from the given state manager.


storeField

protected void storeField(OpenJPAStateManager sm,
                          FieldMetaData fmd)
Store field-level information from the given state manager.


storeIntermediate

protected void storeIntermediate(OpenJPAStateManager sm,
                                 FieldMetaData fmd)
Store the intermediate field value for the given field.


storeImplData

protected void storeImplData(OpenJPAStateManager sm,
                             FieldMetaData fmd,
                             boolean fieldLoaded)
Store impl data for the given field.


newEmbeddedPCData

public AbstractPCData newEmbeddedPCData(OpenJPAStateManager sm)
Return a new PCData implementation of the right type for embedded instances. Returns a PCDataImpl by default.

Specified by:
newEmbeddedPCData in class AbstractPCData

getCache

public String getCache()
Description copied from interface: PCData
Get the name of the cache where this data is stored.



Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.