Using Caché Objects - InterSystems Documentation
Using Caché Objects - InterSystems Documentation
Using Caché Objects - InterSystems Documentation
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Object Persistence<br />
The storage class used by a persistent class is specified by a Storage Definition. A storage<br />
definition contains a set of keywords and values that define a storage class as well as additional<br />
parameters used by the storage interface.<br />
A persistent class may contain more than one storage definition but only one can be active<br />
at a time. The active storage definition is specified using the class' StorageStrategy keyword.<br />
By default, a persistent class has a single storage definition called “Default” .<br />
12.4.1 The %CacheStorage Storage Class<br />
%CacheStorage is the default storage class used by persistent objects. It automatically creates<br />
and maintains a default storage structure for a persistent class.<br />
Whenever you create a new persistent class, it will automatically use the %CacheStorage<br />
storage class. The %CacheStorage class lets you control certain aspects of the storage structure<br />
used for a class by means of the various keywords in the storage definition.<br />
Refer to the Storage Keywords section of the Class Definition Reference for details on the<br />
various storage keywords.<br />
12.4.2 The %CacheSQLStorage Storage Class<br />
The %CacheSQLStorage is a special storage class that uses generated SQL SELECT, INSERT,<br />
UPDATE, and DELETE statements to provide object persistence.<br />
The %CacheSQLStorage is typically used for:<br />
• Mapping objects to preexisting global structures used by older applications.<br />
• Storing objects within an external relational database using the SQL Gateway.<br />
The %CacheSQLStorage is more limited than %CacheStorage. Specifically, it does not<br />
automatically support Schema Evolution or multi-class extents.<br />
12.5 Schema Evolution<br />
The %CacheStorage storage class supports automatic schema evolution.<br />
When you compile a persistent (or serial) class that uses the default %CacheStorage storage<br />
class, the Class Compiler will analyze the properties defined by the class and automatically<br />
add them<br />
110 <strong>Using</strong> <strong>Caché</strong> <strong>Objects</strong>