Package wt.fc
Class ObjectReference
java.lang.Object
wt.fc._ObjectReference
wt.fc.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
@GenAsObjectMappable(interfaces=WTReference.class,serializable=EVOLVABLE,extendable=true,versions=-2986876507294167975L,properties={@GeneratedProperty(name="key",type=ObjectIdentifier.class,javaDoc="Lookup key for referenced target object.",accessors=@PropertyAccessors(setExceptions={}),constraints=@PropertyConstraints(required=true)),@GeneratedProperty(name="object",type=Persistable.class,concrete=false,javaDoc="The member \'object\' represents the target (object) of this class",supportedAPI=PUBLIC,accessors=@PropertyAccessors(setAccess=PRIVATE,getExceptions=WTRuntimeException.class,setExceptions={}),columnProperties=@ColumnProperties(persistent=false))},derivedProperties=@DerivedProperty(name="objectId",derivedFrom="key",supportedAPI=PRIVATE,accessors=@PropertyAccessors(setExceptions={})))
public class ObjectReference
extends _ObjectReference
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 TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.getKey()Returns the key for the target of thisObjectReference
Supported API: trueReturns the target object of this reference.inthashCode()Returns a hash code value for the object.static ObjectReferenceConstructs a reference to the object identified by anObjectIdentifier.static ObjectReferenceConstructs a reference to aPersistableobject, the target of this reference.booleanreferences(Persistable obj) Returns true if this reference is inflated with a persistent object (its target) and it'sObjectIdentifieris equal to that of the specifiedPersistableobject, otherwise returns false
Supported API: truevoidrefresh()Refreshes the target object of thisObjectReferenceensuring that it is consistent with the persisted instance.voidsetObject(Persistable a_Object) Sets the target object of thisObjectReferenceto the specified object
Supported API: truetoString()Returns aStringrepresentation of the target object being referenced.
-
Method Details
-
toString
Returns aStringrepresentation of the target object being referenced.
Supported API: true- Overrides:
toStringin class_ObjectReference- Returns:
- String
-
newObjectReference
Constructs a reference to aPersistableobject, the target of this reference.
Supported API: true- Parameters:
obj-- Returns:
- ObjectReference
- Throws:
WTException
-
newObjectReference
Constructs a reference to the object identified by anObjectIdentifier.
Supported API: true- Parameters:
objId- identifier of the object to be referenced- Returns:
- ObjectReference
- Throws:
WTException
-
equals
Indicates whether some other object is "equal to" this one.
Supported API: true- Specified by:
equalsin interfaceWTReference- Overrides:
equalsin classObject- Parameters:
obj-- Returns:
- boolean
-
hashCode
public int hashCode()Returns a hash code value for the object.
Supported API: true- Specified by:
hashCodein interfaceWTReference- Overrides:
hashCodein classObject- Returns:
- int
-
refresh
Refreshes the target object of thisObjectReferenceensuring that it is consistent with the persisted instance.
Supported API: true- Throws:
WTException
-
references
Returns true if this reference is inflated with a persistent object (its target) and it'sObjectIdentifieris equal to that of the specifiedPersistableobject, otherwise returns false
Supported API: true- Parameters:
obj-- Returns:
- boolean
-
setObject
Sets the target object of thisObjectReferenceto the specified object
Supported API: true- Parameters:
a_Object-
-
getObject
Returns the target object of this reference. If the target is not set but a key is thisObjectReferencewill 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 thisObjectReferenceelse an exception is thrown.
Supported API: true- Specified by:
getObjectin interface_WTReference- Specified by:
getObjectin interfaceWTReference- Specified by:
getObjectin class_ObjectReference- Returns:
- Persistable
- Throws:
WTRuntimeException- See Also:
-
getKey
Returns the key for the target of thisObjectReference
Supported API: true- Specified by:
getKeyin interface_WTReference- Overrides:
getKeyin class_ObjectReference- Returns:
- QueryKey
- See Also:
-