| User's Guide: A Framework for Object Persistency for GNAT; Version 0.6.1; Document Revision $Revision: 1.17 $ | ||
|---|---|---|
| Prev | Next | |
Since ODL is only a minor extension of Ada 95 only the extensions are described below on basis of examples.
The example below (Test.odb) shows a short fragment. It defines the two types X, Object. The type object is defined as a persistent object which is defined in more detail in the private section of the file.
Example 6-1. A minimal Object Model file
package Test is
type Object is persistent private;
type X is new Integer;
private
type Object is persistent record
A,X,Y : attribute Integer ; -- this goes into the DB
B : attribute String(1..50) ; -- this also
C : Integer := 2222; -- this not
end record ;
end Test;
This section describes how persistent object are defined in the ODL language.
This keyword may be used in a type definition of a record. The keyword indicates, that the following record definition defines a persistent object.
The attribute keyword may only be used within persistent object. Itr allows to indicate those fields which will be stored in the persistent object storage.
All fields in a persistent object which are not marked as an attribute will not be stored in the object storage.