org.apache.openjpa.kernel
Class SingleFieldManager

java.lang.Object
  extended by org.apache.openjpa.kernel.TransferFieldManager
      extended by org.apache.openjpa.kernel.SingleFieldManager
All Implemented Interfaces:
Serializable, FieldConsumer, FieldManager, FieldSupplier

 class SingleFieldManager
extends TransferFieldManager
implements Serializable

FieldManager type used to hold onto a single field value and then dispense it via the fetch methods. The manager can also perform actions on the held field.

Author:
Abe White

Field Summary
 
Fields inherited from class org.apache.openjpa.kernel.TransferFieldManager
dblval, field, longval, objval
 
Constructor Summary
SingleFieldManager(StateManagerImpl sm, BrokerImpl broker)
           
 
Method Summary
 void delete(OpCallbacks call)
          Delete and/or dereference field values.
(package private)  void delete(ValueMetaData vmd, Object obj, OpCallbacks call)
          Delete an object embedded in the given value.
 void dereferenceDependent()
          Dereference field values.
(package private)  void dereferenceDependent(Object obj)
          Dereference the given object.
(package private)  void dereferenceEmbedDependent(StateManagerImpl sm)
           
 void gatherCascadeRefresh(OpCallbacks call)
          Recursively invoke the broker to gather cascade-refresh objects in the current field into the given set.
 boolean isDefaultValue()
          Return true if the last-provided field has a default value.
 void persist(OpCallbacks call)
          Persist the stored field safely, preventing infinite recursion using the given set of already-persisted objects.
 boolean preFlush(boolean logical, OpCallbacks call)
          Perform pre-flush tasks on the current field.
 boolean proxy(boolean reset, boolean replaceNull)
          Proxy the held field if needed.
 void releaseEmbedded()
          Release the currently embedded field (make it transient).
 void serialize(ObjectOutput out, boolean def)
          Write the stored field or its default value to the given stream.
 void unproxy()
          Unproxies the current field if needed.
 
Methods inherited from class org.apache.openjpa.kernel.TransferFieldManager
clear, fetchBooleanField, fetchByteField, fetchCharField, fetchDoubleField, fetchFloatField, fetchIntField, fetchLongField, fetchObjectField, fetchShortField, fetchStringField, storeBooleanField, storeByteField, storeCharField, storeDoubleField, storeFloatField, storeIntField, storeLongField, storeObjectField, storeShortField, storeStringField
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleFieldManager

public SingleFieldManager(StateManagerImpl sm,
                          BrokerImpl broker)
Method Detail

proxy

public boolean proxy(boolean reset,
                     boolean replaceNull)
Proxy the held field if needed. Return true if the field needs to be replaced with the now-proxied instance.


unproxy

public void unproxy()
Unproxies the current field if needed.


releaseEmbedded

public void releaseEmbedded()
Release the currently embedded field (make it transient).


persist

public void persist(OpCallbacks call)
Persist the stored field safely, preventing infinite recursion using the given set of already-persisted objects. This method is only called for fields that we know have cascade-immediate settings.


delete

public void delete(OpCallbacks call)
Delete and/or dereference field values.


dereferenceDependent

public void dereferenceDependent()
Dereference field values.


delete

void delete(ValueMetaData vmd,
            Object obj,
            OpCallbacks call)
Delete an object embedded in the given value.


dereferenceDependent

void dereferenceDependent(Object obj)
Dereference the given object.


dereferenceEmbedDependent

void dereferenceEmbedDependent(StateManagerImpl sm)

gatherCascadeRefresh

public void gatherCascadeRefresh(OpCallbacks call)
Recursively invoke the broker to gather cascade-refresh objects in the current field into the given set. This method is only called for fields that we know have cascade-refresh settings.


preFlush

public boolean preFlush(boolean logical,
                        OpCallbacks call)
Perform pre-flush tasks on the current field. This includes checking for nulls, persisting pcs, embedding embedded fields, and ref'ing pc fields. Return true if the field needs to be replaced with the new value.


isDefaultValue

public boolean isDefaultValue()
Return true if the last-provided field has a default value.


serialize

public void serialize(ObjectOutput out,
                      boolean def)
               throws IOException
Write the stored field or its default value to the given stream.

Throws:
IOException


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