docs.intersystems.com
Home / Class Definition Reference / Class Keywords / StorageStrategy

Class Definition Reference
StorageStrategy
Previous section           Next section
InterSystems: The power behind what matters   
Search:  


Specifies which storage definition controls persistence for this class. Applies only to persistent and serial classes.
Usage
To specify which storage definition the class uses, use syntax like the following:
Class MyApp.MyClass Extends %Persistent [ StorageStrategy = MyStorage ] 
{ //class members }
Where MyStorage is the name of a storage definition in this class.
Details
This keyword specifies which storage definition is used to define the storage structure used by this class.
Typically you do not worry about this keyword or about storage structures; the class compiler will automatically define a storage structure named “Default” and maintain it (add new fields as appropriate) for you. It is possible to create more than one storage definition for a class. In this case, this keyword is used to specify which storage definition the class compiler should use.
Effect on Subclasses
This keyword is inherited from the primary superclass. The subclass can override the value of the keyword.
Default
If you omit this keyword, the persistence for this class is defined by the default storage definition, named Default.
See Also


Previous section           Next section
Send us comments on this page
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-05-21 07:39:07