Declarative Objectivity (DO) Language : Operator Expressions : Reference Operators
Reference Operators
Reference operators produce Boolean values when testing a reference to an existing persistent object.
      
Operator
Description
Usage
Unary Operand
(op1)
Result Type
IS_NULL
Checks for a null value; returns true if the reference value is 0-0-0-0.
IS_NULL(op1)
Reference
Boolean
IS_VALID
Checks for a valid reference; returns true if the reference is an object identifier (OID) for an existing object.
IS_VALID(op1)
Reference
Boolean
OBJECT
Returns the persistent object to which the reference points.
OBJECT(op1)
Reference
Object
Quick Look 
Find all vehicles that have not been assigned to stalls.
FROM Vehicle WHERE IS_NULL(atStall) RETURN atStall;
Find all vehicles that are assigned to stalls.
FROM Vehicle WHERE !IS_NULL(atStall) RETURN atStall;
Show the class and attribute values of the object with the specified object identifier:
SHOW OBJECT(3-3-1-41);
Discussion 
For general information about operator formats, operands, and precedence, see About Operator Expressions.
A reference is a value that refers to an existing persistent object that is stored in a federated database. References are the mechanism for representing relationships between objects. When two objects are bidirectionally related to each other, they each have an attribute holding a reference to the other; updating the attribute in one object automatically updates the inverse attribute in the other. If the relationship is unidirectional, only one of the objects holds a reference to the other.
A reference is based on an object identifier (also called an OID), which uniquely identifies a particular object by its location within the federated database. In fact, OIDs are used as the literal expressions for specifying reference values. For example, 3-3-2-80 is the literal expression for a reference to a persistent object whose object identifier is 3-3-2-80.
You use the following reference operators to test references:
IS_NULL indicates whether a reference attribute actually holds a reference value. The operator returns true if the attribute was never set, or if has been cleared with a CLEAR Clause. The operator returns false if the attribute holds a nonnull reference, which may, but need not, be a valid reference.
IS_VALID indicates whether a reference attribute refers to an existing object. This is particularly useful for testing whether a reference attribute refers to a deleted object.
You use the following reference operator to find out about a referenced object:
OBJECT returns the class and attribute values of the object to which the specified reference attribute or reference literal refers. Expressions with this operator are typically used in a SHOW statement or a RETURN clause.