Package wt.fc

Class ObjectReference

All Implemented Interfaces:
Externalizable, Serializable, wt.fc._NetFactor, wt.fc._ObjectMappable, _WTReference, NetFactor, ObjectMappable, WTReference, Evolvable
Direct Known Subclasses:
wt.fc._CachedObjectReference, wt.effectivity._ConfigurationItemReference, wt.facade.persistedcollection._PersistedCollectionReference, wt.team._TeamReference, wt.org._WTPrincipalReference

Holds a reference to a Persistable object, referred to as its target. Additionally the last "read checked" principal (LCP) that accessed the target object of this reference may be recorded as part of state of an ObjectReference.

Use the newObjectReference static factory method(s), not the ObjectReference constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: true

Extendable: true

See Also:
  • Field Summary

    Fields inherited from class wt.fc._ObjectReference

    OBJECT
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether some other object is "equal to" this one.
    Returns the key for the target of this ObjectReference

    Supported API: true
    Returns the target object of this reference.
    int
    Returns a hash code value for the object.
    Constructs a reference to the object identified by an ObjectIdentifier.
    Constructs a reference to a Persistable object, the target of this reference.
    boolean
    Returns true if this reference is inflated with a persistent object (its target) and it's ObjectIdentifier is equal to that of the specified Persistable object, otherwise returns false

    Supported API: true
    void
    Refreshes the target object of this ObjectReference ensuring that it is consistent with the persisted instance.
    void
    Sets the target object of this ObjectReference to the specified object

    Supported API: true
    Returns a String representation of the target object being referenced.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Method Details

    • toString

      public String toString()
      Returns a String representation of the target object being referenced.

      Supported API: true
      Overrides:
      toString in class _ObjectReference
      Returns:
      String
    • newObjectReference

      public static ObjectReference newObjectReference(Persistable obj) throws WTException
      Constructs a reference to a Persistable object, the target of this reference.

      Supported API: true
      Parameters:
      obj -
      Returns:
      ObjectReference
      Throws:
      WTException
    • newObjectReference

      public static ObjectReference newObjectReference(ObjectIdentifier objId) throws WTException
      Constructs a reference to the object identified by an ObjectIdentifier.

      Supported API: true
      Parameters:
      objId - identifier of the object to be referenced
      Returns:
      ObjectReference
      Throws:
      WTException
    • equals

      public boolean equals(Object obj)
      Indicates whether some other object is "equal to" this one.

      Supported API: true
      Specified by:
      equals in interface WTReference
      Overrides:
      equals in class Object
      Parameters:
      obj -
      Returns:
      boolean
    • hashCode

      public int hashCode()
      Returns a hash code value for the object.

      Supported API: true
      Specified by:
      hashCode in interface WTReference
      Overrides:
      hashCode in class Object
      Returns:
      int
    • refresh

      public void refresh() throws WTException
      Refreshes the target object of this ObjectReference ensuring that it is consistent with the persisted instance.

      Supported API: true
      Throws:
      WTException
    • references

      public boolean references(Persistable obj)
      Returns true if this reference is inflated with a persistent object (its target) and it's ObjectIdentifier is equal to that of the specified Persistable object, otherwise returns false

      Supported API: true
      Parameters:
      obj -
      Returns:
      boolean
    • setObject

      public void setObject(Persistable a_Object)
      Sets the target object of this ObjectReference to the specified object

      Supported API: true
      Parameters:
      a_Object -
    • getObject

      public Persistable getObject() throws WTRuntimeException
      Returns the target object of this reference. If the target is not set but a key is this ObjectReference will be inflated based on the value of the key. As part of inflation, and all subsequent access calls to the retrieve the target object, access control checks are done for the current principal. If the current principal has read access to the target then the principal is recorded as part of the state of this ObjectReference else an exception is thrown.

      Supported API: true
      Specified by:
      getObject in interface _WTReference
      Specified by:
      getObject in interface WTReference
      Specified by:
      getObject in class _ObjectReference
      Returns:
      Persistable
      Throws:
      WTRuntimeException
      See Also:
    • getKey

      public QueryKey getKey()
      Returns the key for the target of this ObjectReference

      Supported API: true
      Specified by:
      getKey in interface _WTReference
      Overrides:
      getKey in class _ObjectReference
      Returns:
      QueryKey
      See Also: