Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new tab

For information on migrating to InterSystems IRISOpens in a new tab, see Why Migrate to InterSystems IRIS?

%Library.CacheRelationship

class %Library.CacheRelationship extends %Library.CacheObject

Object Relationship Property Class

Method Inventory

Parameters

parameter ACCESSPOLICY;
ACCESSPOLICY defines how collection is fetched to the client application. EAGER: The whole collection is fetched no later than it is first accessed by application in any manner. If collection contains object values then objects are opened and instantiated in application memory. For applications using POJO mode this means that application can use this collection even if it has been disconnected from the server afterwards. Value EAGER is a requirement, meaning that if it is specified then EAGER policy always be employed. LAZY: Values in collection can be fetched as they are requested by the application, e.g. when methods get() or Iterator.next() are invoked. Value LAZY is a hint meaning that if it is specified it tells that LAZY policy may be used for this collection but does not guarantee that it is used. In case LAZY fetching is used collection may become invalid when application disconnected from the server.

Methods

method GetSwizzled(noswizzle As %Library.Boolean = 0) as %RegisteredObject
Return the oref of the object referenced by this property. If the oref isn't present then swizzle the OID to produce one and relate the objects.
method NewObject() as %ObjectHandle
Creates a new instance of this property's type class and returns its reference to the caller.
classmethod OnDelete(id As %CacheString = "", concurrency As %Integer = -1) as %Status
classmethod RClose(%qHandle As %Binary) as %Status
Close the query that returns a list of related objects.
classmethod RExec(ByRef %qHandle As %Binary, inverse As %String) as %Status
Instantiate a query that returns a list of objects related to inverse.
classmethod RFetch(ByRef %qHandle As %Binary, FetchCount As %Integer = 0, ByRef RowSet As %List, ByRef ReturnCount As %Integer, ByRef AtEnd As %Integer) as %Status
Returns up to FetchCount number of rows (or up to 32k of data if FetchCount is zero) in RowSet. ReturnCount indicates the number of rows returned. AtEnd is TRUE if the query encountered an end-of-data condition while retrieving data - in other words, don't try calling again.
method Relate(oref) as %Status
Connect two objects in memory so that the relationship in each object has a swizzled reference to its inverse relationship in the other object.
method Set(newvalue As %String) as %Status
Set the value of this property to newvalue. If this property has a current value that that is not newvalue then %Close it, decrement its reference count and UnRelate() it. Relate() the new value.
method SetObject(newvalue As %ObjectIdentity) as %Status
This method stores a new value for the OID of the referenced object. if swizzling has not occurred, it simply stores the OID (after perhaps stripping the class name if CLASSNAME=0). If swizzling has occurred, then it references the object to obtain its OID. If it is the same, then nothing happens. If they are different then the old object is closed and the new OID is stored.
method SetObjectId(newid As %String) as %Status
This method stores simply calls SetObject() with constructed Oid |
method UnRelate(oref) as %Status
Terminate the relationship between two objects. For multi-valued relationships just invoke its UnRelate() method.

Inherited Members

Inherited Methods

FeedbackOpens in a new tab