org.jpox.sco
Interface SCO

All Known Subinterfaces:
SCOCollection, SCOList, SCOMap
All Known Implementing Classes:
ArrayList, BitSet, Collection, Date, GregorianCalendar, HashMap, HashSet, Hashtable, LinkedHashMap, LinkedHashSet, LinkedList, List, Map, Point, Properties, Set, SortedMap, SortedSet, SqlDate, SqlTime, SqlTimestamp, Stack, TreeMap, TreeSet, Vector

public interface SCO

Representation of a wrapper/proxy for a mutable SCO type supported by JPOX. An implementation of this interface must have a constructor with the arguments StateManager ownerSM, String fieldName (Constructor(StateManager owner, String fieldName))

Version:
$Revision: 1.18 $

Method Summary
 void attachCopy(java.lang.Object value)
          Method to return an attached copy of this object.
 java.lang.Object clone()
          Mutable second class objects are required to provide a public clone method so that copying of PersistenceCapable objects can take place.
 void detach(FetchPlanState state)
          Method to detach this object.
 java.lang.Object detachCopy(FetchPlanState state)
          Method to return a detached copy of this object.
 java.lang.String getFieldName()
          Returns the field name.
 java.lang.Object getOwner()
          Returns the owner object of the SCO instance.
 void makeTransient(FetchPlanState state)
          Method to make the object transient.
 void runReachability(java.util.Set reachables)
          Method to run reachability from this SCO.
 void setValueFrom(java.lang.Object obj, boolean forUpdate)
          Assigns the value of this second-class object from an existing object of the same or compatible type.
 void unsetOwner()
          Nullifies references to the owner Object and Field.
 

Method Detail

setValueFrom

public void setValueFrom(java.lang.Object obj,
                         boolean forUpdate)
                  throws java.lang.ClassCastException
Assigns the value of this second-class object from an existing object of the same or compatible type.

Parameters:
obj - the object from which to copy the value.
forUpdate - Whether the object needs updating in the datastore with this value
Throws:
java.lang.ClassCastException - Thrown if the given object is not of a type that's compatible with this second-class wrapper object.

getFieldName

public java.lang.String getFieldName()
Returns the field name.

Returns:
field name. Returns null if the SCO instance is not associated with an owner.

getOwner

public java.lang.Object getOwner()
Returns the owner object of the SCO instance. Usually it's an instance of PersistenceCapable.

Internally, the SCO implementation can obtain the owner instance from the ownerSM.getObject() call.

Returns:
owner object

unsetOwner

public void unsetOwner()
Nullifies references to the owner Object and Field.

As pos-condition, the SCO instance is no longer associated with the owner, thus should not issue any request to the datastore. All references to a StateManager or PersistenceCapable must be released.


clone

public java.lang.Object clone()
Mutable second class objects are required to provide a public clone method so that copying of PersistenceCapable objects can take place. This mustn't throw a CloneNotSupportedException.

Returns:
A clone of the object

runReachability

public void runReachability(java.util.Set reachables)
Method to run reachability from this SCO.

Parameters:
reachables - List of StateManagers reachable so far

makeTransient

public void makeTransient(FetchPlanState state)
Method to make the object transient. Makes transient all components of this object that are also PersistenceCapable.

Parameters:
state - State of the fetchplan process

detach

public void detach(FetchPlanState state)
Method to detach this object. Detaches all components of this object that are also PersistenceCapable.

Parameters:
state - State for the detachment process

detachCopy

public java.lang.Object detachCopy(FetchPlanState state)
Method to return a detached copy of this object. Detaches all components of this object that are also PersistenceCapable.

Parameters:
state - State of the detachment process
Returns:
The detached copy

attachCopy

public void attachCopy(java.lang.Object value)
Method to return an attached copy of this object. Attaches all components of this object that are also PersistenceCapable.

Parameters:
value - The object value from the detached instance


Copyright © -2007 . All Rights Reserved.