This is the README file for SAMPLES-DATA. The end of the file has setup instructions.
Use or operation of this code is subject to acceptance of the license available in the code repository for this code.
SAMPLES-DATA is meant for use with the InterSystems IRIS. There are three purposes for these classes:
To provide sample data that you can query via InterSystems IRIS SQL, for any basic proof-of-concept testing. You can query this data via the SQL shell, via the Management Portal, via JDBC or ODBC, or via server-side code.
To give you a way to explore some of the basic concepts of InterSystems IRIS object classes. Features include serial objects, relationships, indexes, calculated properties, and a class query.
Because InterSystems IRIS persistent classes let you access data either via SQL or via the object methods, this simple set of classes lets you become familiar with creating, retrieving, updating, and deleting data, via either mechanism. You can also use the classes to become familiar with the SQL projections of persistent classes.
To provide a simple demonstration of the built-in data population utility (%Library.Populate), which you can use to generate data for other proof-of-concept scenarios.
The InterSystems ObjectScript documentation and the InterSystems SQL documentation use these tables and classes extensively.
Contents of the Sample package
Sample.Personrepresents a person. This class is projected to SQL as the table
Sample.Person. Of note:
- The properties
Officeare references to the serial object class
Ageis a calculated property.
ByNameis a class query.
- The properties
Sample.Addressis a serial object class, representing a street address.
Sample.Personuses this class as the type of the
Sample.Employeeis a subclass of
Sample.Person. This class is projected to SQL as the table
Sample.Employee. The records for
Sample.Employeeare also included in the table
Sample.Companyrepresents a company. This class is projected to SQL as the table
Sample.Company. Each company has a relationship properties that connects to the
Sample.Customeris another sample serial object class.
Sample.Vendordemonstrates how to use the
%Library.CacheSQLStoragestorage class to provide custom storage for a persistent class.
- Clone or download the repository.
- If you have not yet created a namespace in InterSystems IRIS, follow the detailed instructions to do so.
- Open the InterSystems IRIS Terminal.
- Enter the following command (replacing
mynamespacewith the namespace where you want to load the sample):
- Enter the following commands (replacing with the full path of the
do $system.OBJ.Load("full-path-to-Build.DataSample.cls","ck") do ##class(Build.DataSample).Build() ``` 6. When prompted, enter the full path of the directory to which you downloaded this sample. The method then loads and compiles the code and performs other needed setup steps.