Persistent storage of information objects
First Claim
1. A computer implemented method of persistently storing an information object, having a plurality of data storage fields, from a primary store to a secondary store, the method comprising the steps of:
- associating metadata with the information object, in which the metadata defines attributes of the secondary store specific to a class of the information object;
receiving a request to read the information object from the secondary store;
when the class of the information object is recognized, retrieving values for the data storage fields from the secondary store and storing the values in a first mapping of the secondary store to the data storage fields;
instantiating the information object, in which the information object inherits from a first class and the information object is defined by a second class subclassed from the first class;
associating a first table of the secondary store with the first class, and associating a second table of the secondary store with the second class;
associating first and second read methods with the first class and the second class, respectively;
invoking the second class in response to receiving a request to read the information object from the secondary store; and
in the second read method, retrieving values for the data storage fields from the second table and storing the values in the information object, recognizing that the values relate only to the second class, and invoking the first read method.
2 Assignments
0 Petitions
Accused Products
Abstract
A method and apparatus for persistently storing information objects in a secondary store is provided. Each object to be stored persistently is made a subclass of a persistent object class. The persistent object declares metadata that defines parameters of a table in the secondary store in which instances of the object are stored, and external requirements of the object. When a persistent object inherits attributes from one or more parent object classes, instances of each parent class are represented in separate tables. When a persistent object is read or written by an application program, methods in the persistent object class automatically retrieve or store information for each field of the persistent object by recursively calling a read method or a write method for each class from which the persistent object inherits, and the object'"'"'s own class. The read method and write methods automatically create and submit commands to the secondary store.
-
Citations
14 Claims
-
1. A computer implemented method of persistently storing an information object, having a plurality of data storage fields, from a primary store to a secondary store, the method comprising the steps of:
-
associating metadata with the information object, in which the metadata defines attributes of the secondary store specific to a class of the information object;
receiving a request to read the information object from the secondary store;
when the class of the information object is recognized, retrieving values for the data storage fields from the secondary store and storing the values in a first mapping of the secondary store to the data storage fields;
instantiating the information object, in which the information object inherits from a first class and the information object is defined by a second class subclassed from the first class;
associating a first table of the secondary store with the first class, and associating a second table of the secondary store with the second class;
associating first and second read methods with the first class and the second class, respectively;
invoking the second class in response to receiving a request to read the information object from the secondary store; and
in the second read method, retrieving values for the data storage fields from the second table and storing the values in the information object, recognizing that the values relate only to the second class, and invoking the first read method. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
declaring the information object and a plurality of other information objects as part of a program component; and
detecting that the information object is marked as modified, and in response thereto, storing the information object and the plurality of other information objects in the secondary store.
-
-
4. The method recited in claim 1, further comprising the steps of:
-
retrieving values for the data storage fields from the second table;
storing each of the values in the first mapping;
detecting when at least one of the values is a reference to a second information object; and
storing, in a second mapping, information that can be used to later resolve the reference to the second information object into second values from the second information object.
-
-
5. The method recited in claim 4, further comprising the steps of resolving the reference to the second information object into second values from the second information object.
-
6. The method recited in claim 4, further comprising the steps of:
storing the information object, and a plurality of other information objects that are associated with a functional component of a program, in the secondary store.
-
7. The method recited in claim 6, in which the step of storing further comprises the steps of:
-
storing values of data storage fields of the information objects in the first mapping;
adding at least one referential constraint, defined in the metadata, to the first mapping; and
executing a storage function of the secondary store based on the first mapping.
-
-
8. The method recited in claim 7, in which the first mapping comprises a hash mapping of values of the data storage fields and names of columns of a table in the secondary store.
-
9. The method recited in claim 6, in which the step of storing further comprises the steps of:
-
receiving a request to write the information object to the secondary store, wherein values of the data storage fields that are to be written to the secondary store are provided in the first mapping;
when the class of the information object is recognized, storing the values into the secondary store based on the first mapping.
-
-
10. A computer implemented method of persistently storing an information object, having a plurality of data storage fields, from a primary store to a secondary store, the method comprising the steps of:
-
associating metadata with the information object, in which the metadata defines attributes of the secondary store specific to a class of the information object;
receiving a request to read the information object from the secondary store;
when the class of the information object is recognized, retrieving values for the data storage fields from the secondary store and storing the values in a first mapping of the secondary store to the data storage fields; and
storing the information object, and a plurality of other information objects that are associated with a functional component of a program, in the secondary store;
in which the step of storing further comprises the steps of;
receiving a request to write the information object to the secondary store, wherein values of the data storage fields that are to be written to the secondary store are provided in the first mapping;
when the class of the information object is recognized, storing the values into the secondary store based on the first mapping; and
when the class of the information object is not recognized, passing execution control to a superclass of the information object that can handle the request to write the information object.
-
-
11. A computer implemented method of persistently storing an information object, having a plurality of data storage fields, from a primary store to a secondary store, the method comprising the steps of:
-
associating metadata with the information object, in which the metadata defines attributes of the secondary store specific to a class of the information object;
receiving a request to read the information object from the secondary store;
when the class of the information object is recognized, retrieving values for the data storage fields from the secondary store and storing the values in a first mapping of the secondary store to the data storage fields; and
when the class of the information object is not recognized, passing execution control to a superclass of the information object that can handle the request to read the information object. - View Dependent Claims (12)
-
-
13. A computer-readable medium carrying one or more sequences of instructions for persistently storing an information object, having a plurality of data storage fields, from a primary store to a secondary store, wherein execution of the one or more sequences of instructions by one or more processors causes the one or more processors to perform the steps of:
-
associating metadata with the information object, in which the metadata defines attributes of the secondary store specific to a class of the information object, in which the step of associating metadata with the information object includes the steps of associating with the information object a stored procedure executable in the secondary store;
receiving a request to read the information object from the secondary store;
when the class of the information object is recognized, retrieving values for the data storage fields from the secondary store and storing the values in a first mapping of the secondary store to the data storage fields;
instantiating the information object, in which the information object inherits from a first class and the information object is defined by a second class subclassed from the first class;
associating a first table of the secondary store with the first class, and associating a second table of the secondary store with the second class;
associating first and second read methods with the first class and the second class, respectively;
invoking the second class in response to receiving a request to read the information object from the secondary store;
in the second read method, retrieving values for the data storage fields from the second table and storing the values in the information object, recognizing that the values relate only to the second class, and invoking the first read method. - View Dependent Claims (14)
-
Specification