This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.

For information on migrating to InterSystems IRIS, see How to Migrate to InterSystems IRIS, available on the WRC Distributions page (login required).

%Library.CacheSQLStorage

abstract class %Library.CacheSQLStorage extends %Library.Storage

The %CacheSQLStorage class contains a set of storage interface methods that use embedded SQL statements, as well as an advanced set of data mapping definition, to provide a way to layer objects on top of pre-existing Caché data structures.

The storage interface methods, which are implemented as method generators, work in conjunction with the persistent interface methods of the %Persistent class to provide persistent behavior for objects.

The methods of %CacheSQLStorage are not meant to be called directly. Use the methods of the %Persistent class which, in turn, call the appropriate %CacheStorage method.

Method Inventory (Including Private)

Parameters

parameter OBJECTSPULLTRIGGERS = 1;
parameter STORAGECOMPILERCLASS = %Compiler.Storage.CacheSQL;

Methods

private final classmethod %DeleteData(id As %String, concurrency As %Integer) as %Status
%DeleteData() Delete object from persistent storage The caller is responsible for calling %IdSet() Don't include class name with id in input parameter
classmethod %Exists(oid As %ObjectIdentity = "") as %Boolean
%Exists() Check to see if an OID exists in the extent of this class...
private final method %LoadData(id As %String) as %Status
Load object from persistent storage into memory The caller is responsible for calling %IdSet() Don't include class name with id in input parameter
classmethod %LockExtent(shared As %Boolean = 0) as %Status
Acquire (s)hared or (e)xclusive locks based on locktype parameter
classmethod %LockId(id As %String, shared As %Boolean = 0, timeout As %Integer) as %Status
Acquire (s)hared or (e)xclusive locks based on locktype parameter
classmethod %PurgeIndices(idxlist As %List = "", lockExtent As %Boolean = 0, pIgnoreIndexList As %CacheString = "") as %Status
Inherited description: Deletes all entries from each index specified in the idxlist argument. If idxlist is empty then all indices that originate in the class are purged. The index definition remains intact.

If pIgnoreIndexList is defined, it should be a $listbuild of index names that should not be purged. This argument allows you to purge all indices except those defined in pIgnoreIndexList. The default value of this argument is "", which means all indices, or all indices specified in pIndexList, will be purged.

Returns a %Status value indicating success or failure. This method is normally generated by the storage class for persistent classes using %Library.CacheStorage or %Library.CacheSQLStorage. Persistent classes using some other storage class, such as %Library.CustomStorage must override this method.

private final method %SaveData(id As %String) as %Status
%SaveData() Save the object to a persistent state (e.g. store it on disk) return: oid or "" if save fails
classmethod %UnlockExtent(shared As %Boolean = 0, immediate As %Boolean = 0) as %Status
Release (s)hared or (e)xclusive locks based on locktype parameter
classmethod %UnlockId(id As %String, shared As %Boolean = 0, immediate As %Boolean = 0) as %Status
Release locks held on an object (identified by the id parameter). If shared is true then the lock released is a shared lock. If immediate is true then release the lock immediately (lock not held until completion of the current transaction)

Inherited Members

Inherited Methods (Including Private)

Feedback