主权项 |
1. A method for managing a database in a data-processing system, the method comprising:
providing, for a set of virtual tables each one comprising a set of virtual columns each one of a data type, a polymorph table stored in the database and a mapping structure, the polymorph table comprising a discrimination column for storing an identifier of the virtual tables and a total number of polymorph columns of each data type equal to a maximum number of the virtual columns of the data type in the virtual tables, and the mapping structure storing mapping information mapping each virtual column to a corresponding one of the polymorph columns of the same data type, receiving a virtual access request for accessing at least part of the virtual tables, the virtual access request being based on at least a selected one of the virtual columns of at least a selected one of the virtual tables, retrieving selected mapping information mapping each selected virtual column to a selected one of the polymorph columns from the mapping structure, converting the virtual access request into a polymorph access request for the polymorph table according to the identifier of said at least one selected virtual table and the selected mapping information, and accessing the polymorph table according to the polymorph access request. |