Home > Class Reference > %SYS namespace > %ExtentMgr.GUID

%ExtentMgr.GUID

persistent class %ExtentMgr.GUID extends %Library.Persistent

SQL Table Name: %ExtentMgr.GUID

GUID,OID value pairs are recorded in ^OBJ.GUID. %ExtentMgr.GUID is a persistent class that models ^OBJ.GUID. This class can be queried using SQL. It is also a fully functioning persistent class with the GUID as the ID value. The OID property is swizzle-able. Instances of this class can be deleted and updated. New instances can be created.


This class defines two indexes. idxGUID is the IDKEY for the class and indexes the GUID value. idxOID is a unique index on OID and indexes the OID value. The GUID value is stored in the idxOID as data. Index methods Open and Exists can be used for various purposes. For example, to see if an OID is defined in the GUID registry, simply call the idxOIDExists() method, passing in the requested OID value. All index Exists() methods will return the ID corresponding to the requested key value in an option pass by reference argument. For example:
	SAMPLES>set person = ##class(Sample.Person).%OpenId(5)
	
	SAMPLES>write "Exists: ",##class(%ExtentMgr.GUID).idxOIDExists(person.%Oid(),.id),", GUID: ",id
	Exists: 1, GUID: A7413A9A-F73C-11DF-BF93-23DF9B6F8200
	SAMPLES>
Remember, OIDs are meant to be opaque values and simply constructing an OID value using $ListBuild is breaking encapsulation and it might not produce the desired results. For example:
	SAMPLES>write "Exists: ",##class(%ExtentMgr.GUID).idxOIDExists($ListBuild(5,"Sample.Person"),.id),", GUID: ",id
	Exists: 0, GUID: 
	SAMPLES>

Property Inventory

Method Inventory

Properties

property GUID as %Library.Binary [ Required ];
Property methods: GUIDGet(), GUIDGetStored(), GUIDIsValid(), GUIDSet()
property OID as %Library.Persistent (CLASSNAME = 1) [ Required ];
Property methods: OIDGet(), OIDGetObject(), OIDGetObjectId(), OIDGetStored(), OIDGetSwizzled(), OIDIsValid(), OIDNewObject(), OIDSet(), OIDSetObject(), OIDSetObjectId(), OIDUnSwizzle()

Methods

classmethod GetGUID(pOID As %Library.Binary = "") as %Library.Binary [ Language = objectscript, SQLProc = GetGUID ]
GetGUID returns a GUID value registered to the object whose OID is pOID. If no GUID is currently assigned to that object or if pOID is NULL then NULL is returned.
classmethod idxOIDExists(pOID As %Library.Binary = "", ByRef id As %String = "") as %Boolean [ Language = objectscript ]
idxOIDExists() This method returns true if a GUID exists whose OID matches the pOID value passed in by the caller. The optional byref id parameter will contain the id matching the object that was found to match the index key value upon a successful return.

Indexes

index (idxGUID on GUID) [IdKey, Type = key];
Index methods: idxGUIDCheck(), idxGUIDDelete(), idxGUIDExists(), idxGUIDOpen(), idxGUIDSQLCheckUnique(), idxGUIDSQLExists(), idxGUIDSQLFindPKeyByConstraint(), idxGUIDSQLFindRowIDByConstraint()
index (idxOID on OID) [Data = GUID, Type = key, Unique];
Index methods: idxOIDCheck(), idxOIDCheckUnique(), idxOIDDelete(), idxOIDExists(), idxOIDOpen(), idxOIDSQLCheckUnique(), idxOIDSQLExists(), idxOIDSQLFindPKeyByConstraint(), idxOIDSQLFindRowIDByConstraint()

Inherited Members

Inherited Methods

Storage

Storage Model: Storage (%ExtentMgr.GUID)

^OBJ.GUID(0)(ID)
=
OID