JP2009223644A - Mapping unit, mapping method and program - Google Patents

Mapping unit, mapping method and program Download PDF

Info

Publication number
JP2009223644A
JP2009223644A JP2008067826A JP2008067826A JP2009223644A JP 2009223644 A JP2009223644 A JP 2009223644A JP 2008067826 A JP2008067826 A JP 2008067826A JP 2008067826 A JP2008067826 A JP 2008067826A JP 2009223644 A JP2009223644 A JP 2009223644A
Authority
JP
Japan
Prior art keywords
mapping
elements
rdb
class
object model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2008067826A
Other languages
Japanese (ja)
Inventor
Takuo Kato
卓雄 加藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2008067826A priority Critical patent/JP2009223644A/en
Publication of JP2009223644A publication Critical patent/JP2009223644A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a mapping unit which is available even when an RDB structure has a fixed restriction, and takes advantage of an object model, and to provide a mapping method and a program. <P>SOLUTION: The mapping unit includes an element storage 1, an RDB storage 2, and a mapping section 34. The element storage 1 stores a plurality of first elements of the object model. The RDB storage 2 stores a plurality of second elements of the relational database. When the relational database structure has a fixed restriction, the mapping section 34 identifies a condition when the corresponding relationship holds between a fourth element among the plurality of second elements to a third element selected from among the plurality of first elements, and generates mapping including the conditional correspondence relationship. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、マッピング装置、マッピング方法およびプログラムに関し、特にオブジェクトモデルとリレーショナルデータベースとの間でのマッピング装置、マッピング方法およびプログラムに関する。   The present invention relates to a mapping device, a mapping method, and a program, and more particularly to a mapping device, a mapping method, and a program between an object model and a relational database.

アプリケーションソフトウェアを、オブジェクト指向技術で開発する場合でも、オブジェクト指向データベースのデータ層にODBMS(オブジェクトデータベース管理システム)を利用せずに、RDBMS(リレーショナルデータベース管理システム)を利用することが多い。この場合、オブジェクトモデルをリレーショナルデータベース(RDB)で保管するために、オブジェクトモデルの各要素とRDBの各要素との間でのマッピング(以下、「ORマッピング」と記す)が必要となる。ただし、オブジェクトモデルの各要素は、クラス(属性を含む)、関連(クラス間の関連)、汎化(クラスとその上位概念のクラスとの関係)に例示される。RDBの各要素は、各テーブルの項目(属性)に例示される。   Even when application software is developed using object-oriented technology, RDBMS (relational database management system) is often used instead of ODBMS (object database management system) for the data layer of an object-oriented database. In this case, in order to store the object model in the relational database (RDB), mapping (hereinafter referred to as “OR mapping”) between each element of the object model and each element of the RDB is necessary. However, each element of the object model is exemplified by class (including attributes), association (association between classes), and generalization (relationship between a class and a class of its upper concept). Each element of RDB is exemplified by an item (attribute) in each table.

オブジェクトモデルとRDBとの間のマッピング方法には、2通りの方法がある。第1のマッピング方法は、オブジェクトモデルを主とし、オブジェクトモデルからRDBを決定する方法である。第2のマッピング方法は、RDBを主とし、RDBのテーブル構造にあわせてオブジェクトモデルを決定する方法である。   There are two methods for mapping between the object model and the RDB. The first mapping method is a method in which an object model is mainly used and an RDB is determined from the object model. The second mapping method is a method in which RDB is mainly used and an object model is determined in accordance with the table structure of RDB.

第1のマッピング方法として、例えば、特開2000−148555号公報にオブジェクトモデルとリレーショナルモデルとの間でのマッピング方法が開示されている。このマッピング方法では、オブジェクトモデルの1クラスがRDBの1テーブルにマッピングされる。オブジェクトモデルの1つの関連はRDBの1テーブルにマッピングされるか、クラスに対応するテーブルに埋め込まれるかしてマッピングされる。また、オブジェクトモデルのクラスや関連のインスタンスは、RDBのテーブルのレコードにマッピングされる。このマッピング方法では、1クラスを複数のテーブルにマッピングする。   As a first mapping method, for example, Japanese Patent Laid-Open No. 2000-148555 discloses a mapping method between an object model and a relational model. In this mapping method, one class of the object model is mapped to one table of RDB. One association of the object model is mapped to one table in the RDB or embedded in a table corresponding to the class. Further, the class of the object model and the related instance are mapped to the record of the RDB table. In this mapping method, one class is mapped to a plurality of tables.

また、特開2007−249345号公報にマッピング装置、マッピング方法およびプログラムが開示されている。このマッピング方法では、要求される処理時間やオブジェクトの使われ方などに応じて、1つ以上のオブジェクトモデルの要素(クラス(属性を含む)、関連、汎化、インスタンス、リンクなど)に対応する、カプセル化が行われる1つのまとまり(RDBラッパー)をつくる。そして、RDBラッパーをオブジェクトモデルの要素のデータを保持できる任意の数のRDBの要素(テーブル、列、行など)と対応させる。   Japanese Unexamined Patent Application Publication No. 2007-249345 discloses a mapping device, a mapping method, and a program. This mapping method corresponds to one or more object model elements (classes (including attributes), associations, generalizations, instances, links, etc.) depending on the required processing time and how the objects are used. Create one batch (RDB wrapper) that is encapsulated. The RDB wrapper is associated with any number of RDB elements (tables, columns, rows, etc.) that can hold the data of the element of the object model.

また、特開2000−155706号公報にオブジェクト指向とリレーショナルデータベースのマッピング方法、装置及びその記録媒体が開示されている。このマッピング方法では、データの登録、参照、更新及び抹消を、既知の手順に従って行うリレーショナルデータベースのアクセス方法において、リレーショナル・データベースに登録されているアクセスしようとするテーブルに関する、当該リレーショナル・データベースに含まれる管理情報を読み出し、該管理情報に基づいて、該アクセステーブル、及びそのアクセステーブルにマッピングされるクラスの間での対応を把握するようにした。   Japanese Patent Laid-Open No. 2000-155706 discloses a mapping method and apparatus for object-oriented and relational databases, and a recording medium therefor. In this mapping method, in relational database access method in which registration, reference, update and deletion of data are performed according to a known procedure, it is included in the relational database regarding the table to be accessed registered in the relational database. The management information is read out, and the correspondence between the access table and the class mapped to the access table is grasped based on the management information.

また、第1及び第2の両方に対応するマッピング方法として、特表2001−518670号公報にオブジェクト指向ソフトウェアを有するリレーショナルデータベースを使用するための目的モデルマッピングおよびランタイムエンジンが開示されている。これは、リレーショナルデータベースを有するオブジェクト指向ソフトウェア応用をインターフェースする方法である。オブジェクトモデルを選択する工程と、データベース中のスキーマと選択されたオブジェクトモデルとの間に少なくともいくつかの関係のマップを発生する工程と、オブジェクト指向ソフトウェア応用に関連した1つのオブジェクトに対応する少なくとも1つのインターフェースオブジェクトを生成するためにマップを使用する工程と、リレーショナルデータベースからデータをアクセスするために、オブジェクト指向応用を有する前記少なくとも1つのインターフェースオブジェクトを使用する工程とを備える。   Moreover, as a mapping method corresponding to both the first and second methods, JP-A-2001-518670 discloses an objective model mapping and runtime engine for using a relational database having object-oriented software. This is a way to interface object oriented software applications with relational databases. Selecting an object model; generating a map of at least some relationships between the schema in the database and the selected object model; and at least one corresponding to an object associated with the object-oriented software application. Using a map to generate one interface object, and using the at least one interface object with an object-oriented application to access data from a relational database.

特開2000−148555号公報JP 2000-148555 A 特開2007−249345号公報JP 2007-249345 A 特開2000−155706号公報JP 2000-155706 A 特表2001−518670号公報JP-T-2001-518670

第1のマッピング方法は、RDBの構造が決定済みの制約である場合には利用できないという問題がある。RDBの構造が決定済みとなる場合としては、既存システムへの追加・改造のため既存システムのRDB構造を変更できない場合、既存システム自体は破棄されるがRDB構造は運用上の理由で継続利用される場合、外部システムとの連携のため外部システムが要求するRDBの構造を守らなければいけない場合などが考えられる。これらの状況は、教科書をはなれたシステム開発の現場では頻繁に発生する。これらの場合に対処できないということは、事実上オブジェクトモデルの利用機会が限られるか、オブジェクトモデルの作成が単なるコスト増になってしまうことを意味している。そのため、RDBの構造が決定済みの制約である場合にも利用可能なマッピング方法が求められる。   The first mapping method has a problem that it cannot be used when the structure of the RDB is a determined constraint. When the RDB structure is determined, if the RDB structure of the existing system cannot be changed due to addition or modification to the existing system, the existing system itself is discarded, but the RDB structure is used continuously for operational reasons. In such a case, there may be a case where the RDB structure required by the external system must be observed for cooperation with the external system. These situations frequently occur in the field of system development that is far from textbooks. Inability to deal with these cases means that the use opportunities of the object model are practically limited, or the creation of the object model is merely a cost increase. Therefore, a mapping method that can be used even when the structure of the RDB is a determined constraint is required.

第2のマッピング方法は、オブジェクトモデルをRDBからリバースで決定することと同義であり、オブジェクトモデルが利点として持つ、変更容易性、理解容易性、規模低減といったメリットをまったく享受できないという問題があった。このようなマッピングが採用される場合としては、既存のRDB構造は変更できないがオブジェクト指向開発が契約条件となっている場合や、オブジェクト指向開発技術を持たない開発者しかアサインできなかった場合などが考えられる。しかし、現在のシステム開発においては、オブジェクト指向開発のメリットを生かした変更容易、理解容易、規模小のシステムが求められている。そのため、RDBの構造が決定済みの制約である場合にもオブジェクトモデルの利点が生かせるマッピング方法が望まれる。   The second mapping method is synonymous with reverse determination of the object model from the RDB, and there is a problem that the advantages such as the ease of change, the ease of understanding, and the reduction in scale, which the object model has as advantages, cannot be enjoyed at all. . Such mapping may be used when the existing RDB structure cannot be changed but object-oriented development is a contract condition, or only developers who do not have object-oriented development technology can be assigned. Conceivable. However, in current system development, there is a demand for a system that is easy to change, easy to understand, and small in scale, taking advantage of object-oriented development. Therefore, a mapping method that can take advantage of the object model even when the structure of the RDB is a determined constraint is desired.

本発明の目的は、RDBの構造が決定済みの制約である場合にも利用可能でオブジェクトモデルの利点が生かせるマッピング装置、マッピング方法およびプログラムを提供することにある。   An object of the present invention is to provide a mapping apparatus, a mapping method, and a program that can be used even when the structure of the RDB is a determined constraint and can take advantage of the object model.

本発明のマッピング装置は、要素格納部と、RDB格納部と、マッピング部とを具備する。要素格納部は、オブジェクトモデルの複数の第1要素を格納する。RDB格納部は、リレーショナルデータベースの複数の第2要素を格納する。マッピング部は、リレーショナルデータベースの構造が決定済みの制約である場合、複数の第1要素から選択された第3要素に対して、複数の第2要素のうちの第4要素との間に対応関係が成り立つ場合の条件を識別し、条件付きの対応関係を含むマッピングを生成する。   The mapping apparatus of the present invention includes an element storage unit, an RDB storage unit, and a mapping unit. The element storage unit stores a plurality of first elements of the object model. The RDB storage unit stores a plurality of second elements of the relational database. When the relational database structure is a determined constraint, the mapping unit has a correspondence relationship with the fourth element of the plurality of second elements for the third element selected from the plurality of first elements. Is identified, and a mapping including a conditional correspondence is generated.

本発明のマッピング方法は、(1)〜(3)ステップを具備する。(1)ステップは、オブジェクトモデルの複数の第1要素及びリレーショナルデータベースの複数の第2要素を参照するステップである。(2)ステップは、リレーショナルデータベースの構造が決定済みの制約である場合、複数の第1要素から選択された第3要素に対して、複数の第2要素のうちの第4要素との間に対応関係が成り立つ場合の条件を識別するステップである。(3)ステップは、条件付きの対応関係を含むマッピングを生成するステップである。   The mapping method of the present invention includes steps (1) to (3). (1) The step is a step of referring to a plurality of first elements of the object model and a plurality of second elements of the relational database. (2) In the step, when the structure of the relational database is a determined constraint, the third element selected from the plurality of first elements is between the fourth element of the plurality of second elements. This is a step of identifying conditions when a correspondence relationship is established. (3) The step is a step of generating a mapping including a conditional correspondence.

本発明のプログラムは、(1)〜(3)ステップを具備するマッピング方法をコンピュータに実行させる。(1)ステップは、マッピング部が、オブジェクトモデルの複数の第1要素を格納する要素格納部と、リレーショナルデータベースの複数の第2要素を格納するRDB格納部とを参照するステップである。(2)ステップは、マッピング部が、リレーショナルデータベースの構造が決定済みの制約である場合、複数の第1要素から選択された第3要素に対して、複数の第2要素のうちの第4要素との間に対応関係が成り立つ場合の条件を識別するステップである。(3)ステップは、マッピング部が、条件付きの対応関係を含むマッピングを生成するステップである。   The program of the present invention causes a computer to execute a mapping method comprising steps (1) to (3). In step (1), the mapping unit refers to an element storage unit that stores a plurality of first elements of an object model and an RDB storage unit that stores a plurality of second elements of a relational database. (2) In the step, when the mapping unit is a constraint whose structure of the relational database has been determined, the fourth element of the plurality of second elements is selected with respect to the third element selected from the plurality of first elements. Is a step of identifying a condition when a correspondence relationship is established between (3) In the step, the mapping unit generates a mapping including a conditional correspondence.

本発明により、RDBの構造が決定済みの制約である場合にも利用可能でオブジェクトモデルの利点が生かせるマッピング装置、マッピング方法およびプログラムを提供できる。   According to the present invention, it is possible to provide a mapping device, a mapping method, and a program that can be used even when the structure of the RDB is a determined constraint and can take advantage of the object model.

以下、本発明のマッピング装置、マッピング方法及びプログラムの実施の形態に関して、添付図面を参照して説明する。   Hereinafter, embodiments of a mapping device, a mapping method, and a program according to the present invention will be described with reference to the accompanying drawings.

まず、本発明の実施の形態に係るマッピング装置について説明する。
図1は、本実施の形態に係るマッピング装置の構成を示すブロック図である。図1は、各マッピング装置100−1、100−2、・・・が双方向通信可能なネットワークで互いに接続されている場合を示している。以下の説明において、各マッピング装置を区別しない場合、マッピング装置100と記す。マッピング装置100は、要素格納部1と、リレーショナルデータベース(RDB)格納部2と、処理部3とを備えている。マッピング装置100はコンピュータのような情報処理装置に例示され、処理部3はそのコンピュータ本体、要素格納部1及びRDB格納部2はその記憶装置にそれぞれ例示される。本実施の形態に係るマッピング装置100は、特開2007−249345号公報のマッピング装置の構成(及び動作)を含め、以下のような構成(及び動作)を備えている。
First, a mapping device according to an embodiment of the present invention will be described.
FIG. 1 is a block diagram showing the configuration of the mapping apparatus according to the present embodiment. FIG. 1 shows a case where the mapping devices 100-1, 100-2,... Are connected to each other via a network capable of bidirectional communication. In the following description, when mapping devices are not distinguished, they are referred to as mapping devices 100. The mapping apparatus 100 includes an element storage unit 1, a relational database (RDB) storage unit 2, and a processing unit 3. The mapping device 100 is exemplified by an information processing device such as a computer, the processing unit 3 is exemplified by the computer main body, and the element storage unit 1 and the RDB storage unit 2 are exemplified by the storage device. The mapping apparatus 100 according to the present embodiment has the following configuration (and operation) including the configuration (and operation) of the mapping apparatus disclosed in Japanese Patent Application Laid-Open No. 2007-249345.

要素格納部1は、オブジェクトモデルの要素(以下、「要素」とも記す)を格納している。図1の例では、要素格納部1は、オブジェクトモデルの要素10a〜10cを格納している。ただし、要素は、クラス(属性を含む)、限定子、クラス間の関連(以下、「関連」と記す)、又は、汎化(クラスとその上位概念のクラスとの関係)に例示される。なお、関連及び汎化もクラスの一種とすれば、要素は、クラスとなる。また、オブジェクトモデルは、各要素のインスタンスも含む。   The element storage unit 1 stores the elements of the object model (hereinafter also referred to as “elements”). In the example of FIG. 1, the element storage unit 1 stores the elements 10 a to 10 c of the object model. However, an element is exemplified by a class (including attributes), a qualifier, a relationship between classes (hereinafter referred to as “relation”), or generalization (a relationship between a class and a class of its higher concept). If association and generalization are also a kind of class, an element is a class. The object model also includes an instance of each element.

RDB格納部2は、RDBを格納している。RDBは、項目とその項目に対応するレコードからなるテーブルや、そのテーブルの行(の値)や、そのテーブルの列(の値)のような、RDBの要素を含んでいる。図1の例では、RDB格納部2は、RDBの要素20a〜20cを格納している。その項目は、(オブジェクトモデルの)要素を格納できる。その項目に対応するレコードは、その項目に格納された要素のデータ(インスタンス)を格納できる。   The RDB storage unit 2 stores the RDB. The RDB includes elements of the RDB such as a table including an item and a record corresponding to the item, a row (value) of the table, and a column (value) of the table. In the example of FIG. 1, the RDB storage unit 2 stores RDB elements 20a to 20c. The item can store elements (of the object model). The record corresponding to the item can store the data (instance) of the element stored in the item.

処理部3は、要素格納部1に格納されている各要素を、RDB格納部2に格納されるテーブルの項目にマッピングする。処理部3は、メモリ31と、受付部32と、選択部33と、マッピング部34と、行追加・削除処理部35とを含む。例えば、処理部3がメモリやCPUや入出力部を有するコンピュータ本体である場合、処理部3はソフトウェア(プログラム)を実行することによって、メモリ31と、受付部32と、選択部33と、マッピング部34と、行追加・削除処理部35とを実現する。   The processing unit 3 maps each element stored in the element storage unit 1 to an item in a table stored in the RDB storage unit 2. The processing unit 3 includes a memory 31, a reception unit 32, a selection unit 33, a mapping unit 34, and a row addition / deletion processing unit 35. For example, when the processing unit 3 is a computer main body having a memory, a CPU, and an input / output unit, the processing unit 3 executes software (programs), thereby causing a memory 31, a reception unit 32, a selection unit 33, a mapping unit, and the like. The unit 34 and the line addition / deletion processing unit 35 are realized.

メモリ31は、処理部3の作業メモリとして使用され、RAM(Random Access Memory)に例示される。   The memory 31 is used as a working memory of the processing unit 3 and is exemplified by a RAM (Random Access Memory).

受付部32は、所与のオブジェクトモデルの要素を受け付ける。所与のオブジェクトモデルの要素は、要素格納部1に格納される。また、受付部32は、所与のRDBの要素を受け付ける。所与のRDBの要素は、RDB格納部2に格納される。   The receiving unit 32 receives elements of a given object model. Elements of a given object model are stored in the element storage unit 1. The receiving unit 32 receives a given RDB element. A given RDB element is stored in the RDB storage unit 2.

マッピング部34は、RDBの構造が決定済みの制約である場合(例示:RDBのテーブルが予め与えられ、変更できない場合)でのオブジェクトモデルと既存のRDB構造とのマッピングを実行する。そのとき、RDBの構造が決定済みの制約である場合に、マッピングにおいて生ずる問題(後述)を解決手段(後述)により解決する。   The mapping unit 34 performs mapping between the object model and the existing RDB structure when the RDB structure is a determined constraint (example: RDB table is given in advance and cannot be changed). At that time, when the structure of the RDB is a determined constraint, a problem (described later) occurring in mapping is solved by a solving means (described later).

すなわち、マッピング部34は、メモリ31に対応関係が格納されたオブジェクトモデルの要素毎に(RDBの要素を生成するのではなく)、解決手段1〜解決手段13、解決手段15、解決手段16のように所与のRDBの要素との対応付けを行い、その対応関係をメモリ31に格納する。また、マッピング部34は、メモリ31に対応関係が格納されたオブジェクトモデルの要素毎に(RDBの要素を生成するのではなく)、解決手段14のようにクラス識別子に対応するRDB要素を作成し、作成したRDB要素をRDB格納部2に格納し、クラスの汎化に関する対応関係をメモリ31に格納する。   In other words, the mapping unit 34 sets each of the object model elements whose correspondences are stored in the memory 31 (instead of generating RDB elements) of the solving means 1 to 13, the solving means 15, and the solving means 16. As described above, association with a given RDB element is performed, and the correspondence relationship is stored in the memory 31. Further, the mapping unit 34 creates an RDB element corresponding to the class identifier as in the solving means 14 for each element of the object model whose correspondence is stored in the memory 31 (instead of generating an RDB element). The created RDB element is stored in the RDB storage unit 2, and the correspondence relationship related to the generalization of the class is stored in the memory 31.

ここで、RDBの構造が決定済みの制約である場合でのオブジェクトモデルと既存のRDB構造とのマッピングの問題点について説明する。RDBの構造が決定済みの制約である場合のオブジェクトモデルと既存のRDB構造とのマッピングには、以下(ア)〜(エ)に挙げるようなオブジェクトモデルの要素(例示:クラス(属性を含む)、関連、汎化、インスタンス、リンク)と既存のRDBの要素(例示:テーブル、行、列、リレーション)との対応関係が1:1ではないという問題がある。   Here, the problem of mapping between an object model and an existing RDB structure when the RDB structure is a determined constraint will be described. For mapping between the object model and the existing RDB structure when the structure of the RDB is a determined constraint, the elements of the object model (example: class (including attributes)) listed below (A) to (D) , Relationship, generalization, instance, link) and existing RDB elements (example: table, row, column, relation) are not 1: 1.

(ア)ひとつのオブジェクトモデルの要素に複数のRDBの要素が対応している。
1.1つのクラスが複数のテーブルに対応している。
2.1つの属性が(複数の)テーブルの複数の列に対応している。
3.1つの関連が複数のテーブルまたは(複数の)テーブルの複数の列に対応している。
4.1つの限定子が(複数の)テーブルの複数の列に対応している。
5.1つのインスタンスまたはリンクが複数の行に対応している。
(A) A plurality of RDB elements correspond to one object model element.
1. One class corresponds to a plurality of tables.
2. One attribute corresponds to multiple columns of table (s).
3. One association corresponds to multiple tables or multiple columns of table (s).
4. One qualifier corresponds to multiple columns of the table (s).
5. One instance or link corresponds to multiple rows.

(イ)複数のオブジェクトモデルの要素がひとつのRDBの要素に対応している。
1.複数のクラスが1つのテーブルに対応している。
2.汎化の関係にある複数のクラスが1つのテーブルに対応している。
3.複数の属性が1つのテーブルの列に対応している。
4.複数の関連が1つのテーブルまたは1つのテーブルの列に対応している。
5.複数の限定子が1つのテーブルの列に対応している。
6.複数のインスタンスまたはリンクが1つの行に対応している。
(A) Elements of a plurality of object models correspond to one RDB element.
1. Multiple classes correspond to one table.
2. A plurality of classes having a generalization relationship correspond to one table.
3. A plurality of attributes correspond to one table column.
4). A plurality of associations correspond to one table or one table column.
5. A plurality of qualifiers correspond to one table column.
6). Multiple instances or links correspond to one row.

(ウ)複数のオブジェクトモデルの要素が複数のRDBの要素に対応している。
1.複数のクラスが複数のテーブルに対応している。
2.複数の属性が(複数の)テーブルの複数の列に対応している。
3.複数の関連が複数のテーブルまたは(複数の)テーブルの複数の列に対応している。
4.複数の限定子が(複数の)テーブルの複数の列に対応している。
5.複数のインスタンスまたはリンクが複数の行に対応している。
(C) Elements of a plurality of object models correspond to elements of a plurality of RDBs.
1. Multiple classes correspond to multiple tables.
2. Multiple attributes correspond to multiple columns of the table (s).
3. Multiple associations correspond to multiple tables or multiple columns of (multiple) tables.
4). Multiple qualifiers correspond to multiple columns of the table (s).
5. Multiple instances or links correspond to multiple rows.

(エ)オブジェクトモデルの要素に対応するRDBの要素がない。
1.クラスに対応するRDBの要素がない。
2.汎化(汎化を扱うためのインスタンスが属するクラスの識別情報)に対応するRDBの要素がない。
3.属性に対応するRDBの要素がない。
4.関連に対応するRDBの要素がない。
5.限定子に対応するRDBの要素がない。
6.インスタンスまたはリンクに対応するRDBの要素がない(上記の(エ)−1、(エ)−4と同じケース)。
(D) There is no RDB element corresponding to the object model element.
1. There is no RDB element corresponding to the class.
2. There is no RDB element corresponding to generalization (identification information of a class to which an instance for handling generalization belongs).
3. There is no RDB element corresponding to the attribute.
4). There is no RDB element corresponding to the association.
5. There is no RDB element corresponding to the qualifier.
6). There is no RDB element corresponding to the instance or link (the same case as the above (D) -1 and (D) -4).

本発明では、変更容易性と実行性能を同時に満たすために、特開2007−249345号公報で記載されている、1つ以上のオブジェクトモデルの要素(例示:クラス(属性を含む)、関連、汎化、インスタンス、リンク)(1a、1b、1c…)に対応するカプセル化が行われる1つのまとまり(処理部3)を作成する構成を元にしている。そして、上記のマッピングの問題を解決するために、処理部3が以下の解決手段1〜16を実行可能なように、処理部3の機能を拡張している。それにより、RDBの構造が決定済みの制約である場合(例示:RDBのテーブルが予め与えられ、変更できない場合)においても、オブジェクトモデルと既存のRDB構造とのマッピングを実現している。
(1)解決手段1:問題(ア)−1の解決手段
(マッピング時)
マッピング部34は、クラスとテーブルが対応する条件を識別し、条件付の対応関係を作成する(例示:クラスの属性の値によって対応するテーブルが異なる)。
(実行時)
マッピング部34は、マッピング時に用意した条件に従ってRDBのCRUD(Create Read Update Delete)の処理を行う。
(2)解決手段2:問題(ア)−2、問題(ア)−4の解決手段
(マッピング時)
マッピング部34は、属性または限定子と各々のテーブルの列と対応する条件を識別し、条件付の対応関係を作成する(例示:インスタンスが属するクラスの種類毎に対応するテーブルの列が異なる)。
1つの属性または限定子(の値)と複数のテーブルの列(の値)との間に計算によって成り立つ対応関係がある場合には、それらを対応させると共に、属性または限定子(の値)からテーブルの列(の値)を求める計算式と、テーブルの列(の値)から属性または限定子(の値)を求める計算式を用意する。
(実行時)
マッピング部34は、マッピング時に用意した条件と計算式に従ってRDBのCRUDの処理を行う。
(3)解決手段3:問題(ア)−3の解決手段
(マッピング時)
マッピング部34は、関連と各々のテーブルまたはテーブルの列と対応する条件を識別し、条件付の対応関係を作成する(例示:リンクが属する関連の種類毎に対応するテーブルの列が異なる)。
1つの関連(リンク)と複数のテーブルの列(の値)との間に計算によって成り立つ対応関係がある場合には、それらを対応させると共に、関連(リンク)からテーブルの列(の値)を求める計算式と、テーブルの列(の値)から関連(リンク)を求める計算式を用意する。
(実行時)
マッピング部34は、マッピング時に用意した条件と計算式に従ってRDBのCRUDの処理を行う。
(4)解決手段4:問題(ア)−5の解決手段
マッピング部34は、問題(ア)−1、問題(ア)−3、あるいは非正規化されたテーブル構造の問題として解決する。
(5)解決手段5:問題(イ)−1、問題(イ)−2の解決手段
(マッピング時)
マッピング部34は、各々のクラスとテーブルが対応する条件を識別し、条件付の対応関係を作成する(例示:テーブルの列の値によって対応するクラスが異なる)。それにより、複数のクラスを1つのテーブルに対応させる。
(実行時)
マッピング部34は、マッピング時に用意した条件に従ってRDBのCRUDの処理を行う。
複数のインスタンスが1つの行に対応する場合には、問題(イ)−6に対する解決手段で解決する。
(6)解決手段6:問題(イ)−3、問題(イ)−5の解決手段
(マッピング時)
マッピング部34は、各々の属性または限定子とテーブルの列が対応する条件を識別し、条件付の対応関係を作成する(例示:テーブルの列の値によって対応する属性が異なる)。
複数の属性または限定子(の値)と1つのテーブルの列(の値)との間に計算によって成り立つ対応関係がある場合には、それらを対応させると共に、属性または限定子(の値)からテーブルの列(の値)を求める計算式と、テーブルの列(の値)から属性または限定子(の値)を求める計算式を用意する。
(実行時)
マッピング部34は、マッピング時に用意した条件と計算式に従ってRDBのCRUDの処理を行う。
(7)解決手段7:問題(イ)−4の解決手段
(マッピング時)
マッピング部34は、各々の関連とテーブルまたはテーブルの列と対応する条件を識別し、条件付の対応関係を作成する(例示:テーブルの列の値によって対応する関連が異なる)。
複数の関連(リンク)とテーブルの列(の値)との間に計算によって成り立つ対応関係がある場合には、それらを対応させると共に、関連(リンク)からテーブルの列(の値)を求める計算式と、テーブルの列(の値)から関連(リンク)を求める計算式を用意する。
(実行時)
マッピング部34は、マッピング時に用意した条件と計算式に従ってRDBのCRUDの処理を行う。
複数のリンクが1つの行に対応する場合には、問題(イ)−6に対する解決手段で解決する。
(8)解決手段8:問題(イ)−6の解決手段
(マッピング時)
マッピング部34は、問題(イ)−1、問題(イ)−2、問題(イ)−4に対する解決手段で解決する。
(実行時)
マッピング部34は、行追加・削除処理部35により、インスタンスの生成を次のいずれかの方法で実行する。
<方法1>
・行追加の実行タイミングを、行に対応する全てのインスタンスが生成されるまで遅延させる。
<方法2>
・未生成のインスタンスの部分に、インスタンスがないことを示すダミーのデータを入れ、行を一時的に追加する。
・インスタンスが生成される毎に、ダミーのデータの部分をインスタンスの属性値で更新する(主キーの値の変更を伴う場合には、行を削除して追加する)。
マッピング部34は、行追加・削除処理部35により、インスタンスの削除を次のいずれかの方法で実行する。
<方法3>
・行削除の実行タイミングを、行に対応する全てのインスタンスが削除されるまで遅延させる。
<方法4>
・削除するインスタンスの部分に、インスタンスがないことを示すダミーのデータを入れる。
・全てのインスタンスが削除されたとき、行を削除する。
(9)解決手段9:問題(ウ)−1の解決手段
(マッピング時)
マッピング部34は、各々のクラスと各々のテーブルが対応する条件を識別し、条件付の対応関係を作成する(例示:クラスの属性の値とテーブルの列の値によって対応関係が異なる)。
複数のテーブルで非キーの列が重複している場合には、非正規化されたテーブル構造の問題であることに注意する(非正規化されたテーブル構造の問題に対する解決手段で解決する)。
(実行時)
マッピング部34は、マッピング時に用意した条件に従ってRDBのCRUDの処理を行う。
複数のインスタンスが1つの行に対応する場合には、問題(イ)−6に対する解決手段で解決する。
(10)解決手段10:問題(ウ)−2、問題(ウ)−4の解決手段
(マッピング時)
マッピング部34は、属性または限定子とテーブルの列が対応する条件を識別し、条件付の対応関係を作成する(例示:インスタンスが属するクラスの種類毎とテーブルの列の値毎に対応関係が異なる)。
複数の属性または限定子(の値)と複数のテーブルの列(の値)との間に計算によって成り立つ対応関係がある場合には、それらを対応させると共に、属性または限定子(の値)からテーブルの列(の値)を求める計算式と、テーブルの列(の値)から属性または限定子(の値)を求める計算式を用意する。
(実行時)
マッピング部34は、マッピング時に用意した条件と計算式に従ってRDBのCRUDの処理を行う。
(11)解決手段11:問題(ウ)−3の解決手段
(マッピング時)
マッピング部34は、各々の関連と各々のテーブルまたはテーブルの列と対応する条件を識別し、条件付の対応関係を作成する(例示:リンクが属する関連の種類とテーブルの列の値毎に対応関係が異なる)。
各々の関連(リンク)と複数のテーブルの列(の値)との間に計算によって成り立つ対応関係がある場合には、それらを対応させると共に、関連(リンク)からテーブルの列(の値)を求める計算式と、テーブルの列(の値)から関連(リンク)を求める計算式を用意する。
(実行時)
マッピング部34は、マッピング時に用意した条件と計算式に従ってRDBのCRUDの処理を行う。
複数のリンクが1つの行に対応する場合には、問題(イ)−6に対する解決手段で解決する。
(12)解決手段12:問題(ウ)−5の解決手段
(マッピング時)
マッピング部34は、問題(ウ)−1、問題(イ)−3に対する解決手段で解決する。
(実行時)
マッピング部34は、解決手段8に対する解決手段で解決する。
(13)解決手段13:問題(エ)−1の解決手段、問題(エ)−6の解決手段(解決手段16でも可)
(マッピング時)
マッピング部34は、従来のORマッピングと同様に、クラスに対応するテーブルを作成(追加)する。
(実行時)
マッピング部34は、従来のORマッピングと同様に対処する。
(14)解決手段14:問題(エ)−2の解決手段
(マッピング時)
マッピング部34は、所与のテーブルへの列の追加が許される場合は、クラスに対応するテーブルにクラス識別子の列を追加する。クラスによってオブジェクトを識別するための主キーが異なる場合には、オブジェクト識別子の列も追加する。
所与のテーブルへの列の追加が許されない場合は、クラスに対応するテーブルの主キーを外部キーとして持ち、クラス識別子の列を持つテーブルを追加する。クラスによってオブジェクトを識別するための主キーが異なる場合には、オブジェクト識別子の列も持たせる。
(実行時)
マッピング部34は、インスタンスの生成・削除時に、クラス識別子を含む行を追加・削除する。
(15)解決手段15:問題(エ)−3、問題(エ)−5の解決手段
(マッピング時)
マッピング部34は、所与のテーブルへの列の追加が許される場合は、クラスに対応するテーブルに属性または限定子に対応する列を追加する。
所与のテーブルへの列の追加が許されない場合は、クラスに対応する主キーを外部キーとして持ち、属性または限定子に対応する列を持つテーブルを追加する。
(実行時)
マッピング部34は、インスタンスの生成・削除時に、属性または限定子を含む行を追加・削除する。
(16)解決手段16:問題(エ)−4の解決手段、問題(エ)−6の解決手段(解決手段13でも可)
(マッピング時)
マッピング部34は、従来のORマッピングと同様に、関連に対応するテーブルを作成(追加)する。ただし、解決手段14によってオブジェクトの識別子を付加した場合を除いて、オブジェクトを識別するための列は、クラスに対応するテーブルの主キーを利用する。
(実行時)
マッピング部34は、従来のORマッピングと同様に対処する。
In the present invention, in order to satisfy both changeability and execution performance at the same time, one or more object model elements (example: class (including attributes)), relationship, general purpose, and the like described in JP-A-2007-249345 are disclosed. , Instance, link) (1a, 1b, 1c...) Is based on a configuration for creating one unit (processing unit 3) in which encapsulation is performed. In order to solve the above mapping problem, the function of the processing unit 3 is expanded so that the processing unit 3 can execute the following solving means 1 to 16. Thereby, even when the structure of the RDB is a determined constraint (example: when the RDB table is given in advance and cannot be changed), the mapping between the object model and the existing RDB structure is realized.
(1) Solution 1: Solution to problem (a) -1 (during mapping)
The mapping unit 34 identifies the condition corresponding to the class and the table, and creates a conditional correspondence (example: the corresponding table differs depending on the value of the class attribute).
(runtime)
The mapping unit 34 performs RDB CRUD (Create Read Update Delete) processing according to the conditions prepared at the time of mapping.
(2) Solution 2: Solution for problem (A) -2 and problem (A) -4 (during mapping)
The mapping unit 34 identifies the conditions corresponding to the attributes or qualifiers and the columns of each table, and creates a conditional correspondence (example: the column of the table corresponding to each class type to which the instance belongs). .
When there is a correspondence relationship established by calculation between one attribute or qualifier (value) and a plurality of table columns (value), they are associated with each other and from the attribute or qualifier (value) A calculation formula for obtaining a table column (value) and a calculation formula for obtaining an attribute or qualifier (value) from the table column (value) are prepared.
(runtime)
The mapping unit 34 performs RDB CRUD processing according to the conditions and calculation formulas prepared at the time of mapping.
(3) Solution 3: Solution for Problem (A) -3 (at mapping)
The mapping unit 34 identifies the relation and the condition corresponding to each table or table column, and creates a conditional correspondence (example: the column of the table corresponding to each type of relation to which the link belongs).
If there is a correspondence established by calculation between one association (link) and multiple table columns (values), they are matched and the table columns (values) are converted from the association (link). A calculation formula to be obtained and a calculation formula to obtain a relationship (link) from the column (value) of the table are prepared.
(runtime)
The mapping unit 34 performs RDB CRUD processing according to the conditions and calculation formulas prepared at the time of mapping.
(4) Solution 4: Solution of Problem (A) -5 The mapping unit 34 solves the problem (A) -1, problem (A) -3, or a problem of a denormalized table structure.
(5) Solution 5: Solution for Problem (A) -1 and Problem (A) -2 (at mapping)
The mapping unit 34 identifies the condition corresponding to each class and the table, and creates a conditional correspondence (example: the corresponding class differs depending on the value of the table column). Thereby, a plurality of classes are associated with one table.
(runtime)
The mapping unit 34 performs RDB CRUD processing according to the conditions prepared at the time of mapping.
When a plurality of instances correspond to one row, it is solved by means for solving the problem (A) -6.
(6) Solution 6: Solution to Problem (A) -3 and Problem (A) -5 (at mapping)
The mapping unit 34 identifies the condition corresponding to each attribute or qualifier and the table column, and creates a conditional correspondence (example: the corresponding attribute varies depending on the value of the table column).
When there is a correspondence relationship established by calculation between a plurality of attributes or qualifiers (values) and one table column (values), they are associated with each other, and from the attributes or qualifiers (values) A calculation formula for obtaining a table column (value) and a calculation formula for obtaining an attribute or qualifier (value) from the table column (value) are prepared.
(runtime)
The mapping unit 34 performs RDB CRUD processing according to the conditions and calculation formulas prepared at the time of mapping.
(7) Solution 7: Solution to Problem (A) -4 (at mapping)
The mapping unit 34 identifies a condition corresponding to each relation and a table or a table column, and creates a conditional correspondence (example: the corresponding relation varies depending on the value of the table column).
When there is a correspondence relationship established by calculation between multiple associations (links) and table columns (values), a calculation that associates them and obtains the table columns (values) from the associations (links) Prepare a formula to calculate the relationship (link) from the formula and the table column (value).
(runtime)
The mapping unit 34 performs RDB CRUD processing according to the conditions and calculation formulas prepared at the time of mapping.
When a plurality of links correspond to one line, it is solved by means for solving the problem (A) -6.
(8) Solution 8: Solution to problem (b) -6 (during mapping)
The mapping unit 34 solves the problem (A) -1, the problem (A) -2, and the problem (A) -4.
(runtime)
The mapping unit 34 uses the row addition / deletion processing unit 35 to generate an instance by one of the following methods.
<Method 1>
Delay the execution timing of adding a row until all instances corresponding to the row are generated.
<Method 2>
・ Dummy data indicating that there is no instance is placed in the ungenerated instance part, and a row is temporarily added.
Each time an instance is created, the dummy data part is updated with the attribute value of the instance (if the primary key value is changed, the row is deleted and added).
The mapping unit 34 uses the row addition / deletion processing unit 35 to delete an instance by one of the following methods.
<Method 3>
Delay the execution timing of row deletion until all instances corresponding to the row are deleted.
<Method 4>
-Insert dummy data indicating that there is no instance in the instance part to be deleted.
• When all instances have been deleted, delete the line.
(9) Solution 9: Solution to problem (c) -1 (during mapping)
The mapping unit 34 identifies a condition corresponding to each class and each table, and creates a conditional correspondence (example: the correspondence differs depending on the value of the class attribute and the value of the table column).
Note that if non-key columns are duplicated in multiple tables, this is a problem of denormalized table structure (solved by a solution to the problem of denormalized table structure).
(runtime)
The mapping unit 34 performs RDB CRUD processing according to the conditions prepared at the time of mapping.
When a plurality of instances correspond to one row, it is solved by means for solving the problem (A) -6.
(10) Solution 10: Solution for problem (c) -2 and problem (c) -4 (during mapping)
The mapping unit 34 identifies the condition corresponding to the attribute or qualifier and the table column, and creates a conditional correspondence (example: for each class type to which the instance belongs and for each value in the table column. Different).
If there is a corresponding relationship established by calculation between multiple attributes or qualifiers (values) and multiple table columns (values), make them correspond and use the attributes or qualifiers (values) A calculation formula for obtaining a table column (value) and a calculation formula for obtaining an attribute or qualifier (value) from the table column (value) are prepared.
(runtime)
The mapping unit 34 performs RDB CRUD processing according to the conditions and calculation formulas prepared at the time of mapping.
(11) Solution 11: Solution for problem (c) -3 (during mapping)
The mapping unit 34 identifies a condition corresponding to each relation and each table or table column, and creates a conditional correspondence (example: corresponding to each kind of relation to which the link belongs and each column value of the table) The relationship is different).
If there is a corresponding relationship established by calculation between each relationship (link) and a plurality of table columns (values), they are matched and the table column (value) is converted from the relationship (link). A calculation formula to be obtained and a calculation formula to obtain a relationship (link) from the column (value) of the table are prepared.
(runtime)
The mapping unit 34 performs RDB CRUD processing according to the conditions and calculation formulas prepared at the time of mapping.
When a plurality of links correspond to one line, it is solved by means for solving the problem (A) -6.
(12) Solution 12: Solution for problem (c) -5 (during mapping)
The mapping unit 34 solves the problem (C) -1 and the problem (A) -3 with a solution.
(runtime)
The mapping unit 34 solves with the solving means for the solving means 8.
(13) Solution 13: Solution to Problem (D) -1, Solution to Problem (D) -6 (Solution 16 may be used)
(When mapping)
The mapping unit 34 creates (adds) a table corresponding to the class, similarly to the conventional OR mapping.
(runtime)
The mapping unit 34 handles the same as in the conventional OR mapping.
(14) Solution 14: Solution for problem (d) -2 (during mapping)
When the column is allowed to be added to a given table, the mapping unit 34 adds a class identifier column to the table corresponding to the class. If the primary key for identifying an object differs depending on the class, an object identifier column is also added.
If the addition of a column to a given table is not permitted, a table having a primary key of the table corresponding to the class as a foreign key and a column of a class identifier is added. If the primary key for identifying an object differs depending on the class, an object identifier column is also provided.
(runtime)
The mapping unit 34 adds / deletes a line including a class identifier when an instance is generated / deleted.
(15) Solution 15: Solution for Problem (D) -3 and Problem (D) -5 (at the time of mapping)
When the addition of a column to a given table is permitted, the mapping unit 34 adds a column corresponding to the attribute or qualifier to the table corresponding to the class.
If adding a column to a given table is not allowed, add a table with a primary key corresponding to the class as a foreign key and a column corresponding to an attribute or qualifier.
(runtime)
The mapping unit 34 adds / deletes a line including an attribute or a qualifier when an instance is generated / deleted.
(16) Solution 16: Solution for Problem (D) -4, Solution for Problem (D) -6 (Solution 13 is also acceptable)
(When mapping)
The mapping unit 34 creates (adds) a table corresponding to the association as in the conventional OR mapping. However, the column for identifying the object uses the primary key of the table corresponding to the class, except when the identifier of the object is added by the solving means 14.
(runtime)
The mapping unit 34 handles the same as in the conventional OR mapping.

行追加・削除処理部35は、マッピング部34の指示に基づいて、複数のインスタンスが1レコードに対応付けられている場合のインスタンスの生成時に、次のいずれかの方法で処理を行う。
<方法1>
・レコード追加の実行タイミングを、全てのインスタンスが生成されるまで遅延させる。
<方法2>
・未生成のインスタンスの部分に、インスタンスがないことを示すダミーのデータを入れ、レコードを一時的に追加する。
・インスタンスが生成される毎に、ダミーのデータの部分をインスタンスの属性値で更新する(主キーの値の変更を伴う場合には、レコードを削除して追加する)。
Based on the instruction from the mapping unit 34, the row addition / deletion processing unit 35 performs processing by one of the following methods when an instance is generated when a plurality of instances are associated with one record.
<Method 1>
-Delay the execution timing of record addition until all instances are generated.
<Method 2>
・ Dummy data indicating that there is no instance is inserted in the ungenerated instance part, and a record is temporarily added.
-Each time an instance is generated, the dummy data part is updated with the attribute value of the instance (if the primary key value is changed, the record is deleted and added).

また、行追加・削除処理部35は、マッピング部34の指示に基づいて、複数のインスタンスが1レコードに対応付けられている場合のインスタンスの削除時に、次のいずれかの方法で処理を行う。
<方法3>
・レコード削除の実行タイミングを、全てのインスタンスが削除されるまで遅延させる。
<方法4>
・削除するインスタンスの部分に、インスタンスがないことを示すダミーのデータを入れる。
・全てのインスタンスが削除されたとき、レコードを削除する。
In addition, the row addition / deletion processing unit 35 performs processing by one of the following methods when deleting an instance when a plurality of instances are associated with one record based on an instruction from the mapping unit 34.
<Method 3>
・ Delay the execution timing of record deletion until all instances are deleted.
<Method 4>
-Insert dummy data indicating that there is no instance in the instance part to be deleted.
-When all instances have been deleted, delete the record.

また、受付部32、選択部33及びマッピング部34は、更に特開2007−249345号公報で記載されている動作を実行可能である。すなわち、以下に示すとおりである。   Further, the reception unit 32, the selection unit 33, and the mapping unit 34 can further perform operations described in Japanese Patent Application Laid-Open No. 2007-249345. That is, as shown below.

受付部32は、カプセル化の対象となる複数の要素を選択するための選択条件(例示:ユーザにて選択された具体的な要素名)を受け付ける。この選択条件にて選択される要素のまとまり(以下、「RDBラッパー」と記す)は、カプセル化の対象となり、それら要素のデータ(インスタンス)を保持できるRDBのテーブルと対応させられる。更に、受付部32は、選択条件に応じて選択された複数の要素のまとめ方を特定するための特定条件(例示:要素の処理に対して要求される処理速度)を受け付ける。   The receiving unit 32 receives a selection condition (example: specific element name selected by the user) for selecting a plurality of elements to be encapsulated. A group of elements selected under this selection condition (hereinafter referred to as “RDB wrapper”) is an object of encapsulation, and is associated with an RDB table that can hold data (instances) of those elements. Furthermore, the reception unit 32 receives a specific condition (example: processing speed required for element processing) for specifying how to group a plurality of elements selected according to the selection condition.

例えば、ユーザは、オブジェクトモデルの中で、高速な処理が要求され、かつ低い柔軟性となっても良い部分がある場合、その部分に対応する複数の要素(例示:複数のクラスと関連および汎化)の名称を表す選択条件を、受付部32に入力する。一方、ユーザは、オブジェクトモデルの中で、高速な処理が求められない部分がある場合、その部分に対応する複数の要素(例示:クラス1つと幾つかの関連)の名称を表す選択条件を、受付部32に入力する。この際、各クラスの使われ方およびオブジェクトモデルの要素の凝集度が考慮されて、選択条件が設定される。なお、選択条件は、要素の名称に限らず適宜変更可能である。   For example, if there is a part in the object model that requires high-speed processing and may be low in flexibility, the user may have a plurality of elements corresponding to the part (for example, a plurality of classes and associations and generalizations). A selection condition representing the name of the categorization) is input to the reception unit 32. On the other hand, when there is a part in the object model where high-speed processing is not required, the user selects a selection condition that represents the names of a plurality of elements (example: one class and some relations) corresponding to the part. Input to the reception unit 32. At this time, the selection conditions are set in consideration of how each class is used and the degree of aggregation of the elements of the object model. The selection condition is not limited to the name of the element and can be changed as appropriate.

選択部33は、要素格納部1に格納されている複数の要素から、受付部32が受け付けた選択条件に合う複数の要素を選択する。選択部33は、その複数の要素をRDBラッパーとしてまとめ、そのRDBラッパーを、メモリ31に格納する。このため、RDBラッパーは、選択条件に基づいて選択された、要素格納部1内の複数の要素と対応する。   The selection unit 33 selects a plurality of elements that meet the selection condition received by the reception unit 32 from the plurality of elements stored in the element storage unit 1. The selection unit 33 collects the plurality of elements as an RDB wrapper, and stores the RDB wrapper in the memory 31. For this reason, the RDB wrapper corresponds to a plurality of elements in the element storage unit 1 selected based on the selection condition.

マッピング部34は、RDB格納部2に格納されているRDBのテーブルの項目に、メモリ31に格納された複数の要素を関連づけて1つのグループとしてマッピングする。例えば、マッピング部34は、RDB格納部2に格納されているRDBの1つのテーブルの項目に、メモリ31に格納された複数の要素をマッピングする。   The mapping unit 34 associates a plurality of elements stored in the memory 31 with the items in the RDB table stored in the RDB storage unit 2 and maps them as one group. For example, the mapping unit 34 maps a plurality of elements stored in the memory 31 to items in one table of the RDB stored in the RDB storage unit 2.

具体的には、マッピング部34は、メモリ31に格納されたRDBラッパーの要素ごとに、その要素をテーブルの項目とする複数のRDBのテーブルをRDB格納部2に作成する。その後、マッピング部34は、それら複数のテーブルを、受付部32が受け付けた特定条件に基づいて非正規化して1つのテーブルにまとめる。例えば、特定条件が、メモリ31に格納されたRDBラッパーの要素に対応するアプリケーションソフトウェアの特定の部分に対する処理時間の要求を表している場合、マッピング部34は、その要求を満足するように、それら複数のテーブルを非正規化して最終的なテーブルにする。マッピング部34によるマッピングにより、RDBラッパーは、そのRDBラッパーに対応する要素が項目にマッピングされたRDBのテーブルと対応する。   Specifically, the mapping unit 34 creates, for each RDB wrapper element stored in the memory 31, a plurality of RDB tables having the elements as table items in the RDB storage unit 2. Thereafter, the mapping unit 34 denormalizes the plurality of tables based on the specific condition received by the receiving unit 32 and combines them into one table. For example, when the specific condition represents a request for processing time for a specific part of the application software corresponding to the element of the RDB wrapper stored in the memory 31, the mapping unit 34 sets the request so as to satisfy the request. Denormalize multiple tables to make final table. By mapping by the mapping unit 34, the RDB wrapper corresponds to an RDB table in which elements corresponding to the RDB wrapper are mapped to items.

なお、マッピング部34は、メモリ31に格納されたRDBラッパーの複数の要素を、別々のRDBのテーブルの項目にマッピングし、それらのテーブルを1つのグループ(RDBラッパーに対応するグループ)として関連づけてもよい。この場合、1つのグループとして関連づけられたRDBの各テーブルは、メモリ31に格納されたRDBラッパーに対応する。   The mapping unit 34 maps a plurality of elements of the RDB wrapper stored in the memory 31 to items of different RDB tables, and associates these tables as one group (a group corresponding to the RDB wrapper). Also good. In this case, each RDB table associated as one group corresponds to the RDB wrapper stored in the memory 31.

マッピング装置100の選択部33、マッピング部34及び行追加・削除処理部35の動作によって、選択条件に基づいて選択された要素格納部1内の複数の要素は、RDBラッパーを介して、RDB格納部2内の複数のRDBの要素(例示:テーブル)と対応付けられる(マッピングされる)。   A plurality of elements in the element storage unit 1 selected based on the selection condition by the operations of the selection unit 33, the mapping unit 34, and the row addition / deletion processing unit 35 of the mapping apparatus 100 are stored in the RDB via the RDB wrapper. It is associated (mapped) with a plurality of RDB elements (example: table) in the section 2.

次に、本発明の実施の形態に係るマッピング方法(マッピング装置の動作)について説明する。
図2は、本発明の実施の形態に係るオブジェクトモデル(の要素)の一例を示す概略図である。この所与のオブジェクトモデルは、要素として、「Party」のクラス(「Party」クラス41)、「分野」のクラス(「分野」クラス42)、「団体」のクラス(「団体」クラス43)、「人」のクラス(「人」クラス44)、「活動」のクラス(「活動」クラス45)、「役職」のクラス(「役職」クラス46)、「Party」と「団体」の関係(汎化)、「Party」と「人」の関係(汎化)、「分野」と「団体」の関連、「団体」と「人」の関連、「活動」の関連クラス、および、「活動」と「役職」の関連を備えている。
Next, a mapping method (operation of the mapping apparatus) according to the embodiment of the present invention will be described.
FIG. 2 is a schematic diagram showing an example of (an element of) an object model according to the embodiment of the present invention. The given object model includes, as elements, a “Party” class (“Party” class 41), a “field” class (“field” class 42), an “organization” class (“organization” class 43), “Person” class (“Person” class 44), “Activity” class (“Activity” class 45), “Position” class (“Position” class 46), and the relationship between “Party” and “Group” (generic ), The relationship between “Party” and “person” (generalization), the relationship between “field” and “organization”, the relationship between “organization” and “person”, the related class of “activity”, and the “activity” It has a “title” relationship.

図2のオブジェクトモデルは、ここでは、以下のような特徴があると仮定する。「分野」は「団体」の分野として使用される。「分野」は必ず「団体」に対するメッセージで必要な動作のみで利用される。「分野名」を検索条件とした団体の検索は高速な処理が要求される。「役職」は必ず「活動」に対するメッセージで必要な動作でのみ利用される。「団体名」と「役職名」を検索条件とした「人」の検索は高速な処理が要求される。「人」は一般的に幅広く利用される(「団体」で活動する人以外も取り扱われる)。   Here, it is assumed that the object model of FIG. 2 has the following characteristics. “Field” is used as the field of “organization”. The “field” is always used only for the operation required for the message to the “group”. High-speed processing is required for group searches using “field name” as a search condition. “Position” is always used only for the action required in the message for “activity”. A search for “person” using “organization name” and “title” as search conditions requires high-speed processing. “People” is generally widely used (other than those who work in “groups”).

図3は、本発明の実施の形態に係るRDBのテーブルの一例を示す概略図である。この所与のRDBのテーブルは、以下のデータを含んでいる。図3(a)は「団体マスタ」51であり、項目として、主キーである「団体名」と、分野名とを含んでいる。図3(b)は「団体活動テーブル」52であり、項目として、主キーであり外部キーでもある氏名と、主キーであり外部キーでもある団体名と、活動期間と、役職名とを含んでいる。図3(c)は「人マスタ」53であり、項目として、主キーである氏名と、生年月日を含んでいる。   FIG. 3 is a schematic diagram showing an example of an RDB table according to the embodiment of the present invention. This given RDB table contains the following data: FIG. 3A shows an “organization master” 51, which includes “organization name” that is a primary key and field names as items. FIG. 3B shows a “group activity table” 52, which includes, as items, a name that is a primary key and a foreign key, a group name that is a primary key and a foreign key, an activity period, and a title. It is out. FIG. 3C shows a “person master” 53, which includes, as items, a name that is a primary key and a date of birth.

図4は、本発明の実施の形態に係るRDBラッパーによるオブジェクトモデルの要素と、RDBラッパーと、RDBの要素のマッピングの一例を示す概略図である。   FIG. 4 is a schematic diagram illustrating an example of mapping of an object model element, an RDB wrapper, and an RDB element by the RDB wrapper according to the embodiment of the present invention.

本発明の実施の形態に係るマッピング方法におけるオブジェクトモデル11(図2と同じ)の要素とRDBラッパー12との対応付けは次のように行われる。ここでは、一例として、「Party」クラス41に関して説明する。   Correspondence between the elements of the object model 11 (same as in FIG. 2) and the RDB wrapper 12 in the mapping method according to the embodiment of the present invention is performed as follows. Here, as an example, the “Party” class 41 will be described.

オブジェクトモデル11は、予め、ユーザ又は他の装置から受付部32により受け付けられ、要素格納部1に格納されている。RDBのテーブル13は、予め、ユーザ又は他の装置から受付部32により受け付けられ、RDB格納部2へ格納されている。   The object model 11 is received in advance by the receiving unit 32 from the user or another device and stored in the element storage unit 1. The RDB table 13 is received in advance by the receiving unit 32 from a user or another device and stored in the RDB storage unit 2.

マッピング部34は、オブジェクトモデル11を参照して、RDBラッパーを作成するために、まず、一つクラス(要素)を選択し、そのクラス(要素)に関する要素を読み出す。   In order to create an RDB wrapper with reference to the object model 11, the mapping unit 34 first selects one class (element) and reads an element related to the class (element).

例えば、マッピング部34は、オブジェクトモデル11を参照して、「Party」クラス41のRDBラッパーである「Partyラッパー」61を作成するために、「Party」のクラス(要素)と、「Party」と「団体」の間の関係(汎化)と、「Party」と「人」の間の関係(汎化)を読み出す。   For example, the mapping unit 34 refers to the object model 11 to create a “Party wrapper” 61 that is an RDB wrapper of the “Party” class 41, a “Party” class (element), and “Party” The relationship (generalization) between “organizations” and the relationship (generalization) between “Party” and “people” are read out.

次に、マッピング部34は、読み出したデータに基づいて、RDBのテーブル13を参照して、RDBラッパーに対応するRDBのテーブルを特定する。そして、解決手段1〜16を用いて、オブジェクトモデルとRDBのテーブルとの関係を示すRDBラッパーを生成する。   Next, the mapping unit 34 refers to the RDB table 13 based on the read data, and identifies the RDB table corresponding to the RDB wrapper. Then, using the solving means 1 to 16, an RDB wrapper indicating the relationship between the object model and the RDB table is generated.

例えば、マッピング部34は、読み出したデータに基づいて、RDBのテーブル13を参照して、「Partyラッパー」61に対応するクラス(「Party」クラス41)に対応するテーブルとして「団体マスタ」51及び「人マスタ」53の2つのテーブルを特定する。マッピング部34は、「Party」クラス41に対応するテーブルは「団体マスタ」51及び「人マスタ」53の2つのテーブルがあるので、条件付の対応関係をメモリ31に格納する。その条件付の対応関係は、条件:クラス=“団体”のとき「団体マスタ」51、条件:クラス=“人”のとき「人マスタ」53、である。マッピング部34によるこのような処理は、解決手段1に対応する。   For example, the mapping unit 34 refers to the RDB table 13 based on the read data, and sets the “organization master” 51 and the table corresponding to the class (“Party” class 41) corresponding to the “Party wrapper” 61. Two tables of “human master” 53 are specified. The mapping unit 34 stores two tables, “organization master” 51 and “person master” 53, corresponding to the “Party” class 41, and stores conditional correspondence in the memory 31. The conditional correspondence is “organization master” 51 when the condition: class = “organization”, and “person master” 53 when the condition: class = “person”. Such processing by the mapping unit 34 corresponds to the solving means 1.

ただし、マッピング部34は、「Party」クラス41の「名称」の属性に対応する列は「団体マスタ.団体名」、「人マスタ.氏名」の2つの列があるので、条件付の対応関係をメモリ31に格納する。その条件付の対応関係は、条件:クラス=“団体”のとき「団体マスタ.団体名」、条件:クラス=“人”のとき「人マスタ.氏名」)をメモリ31に格納する。マッピング部34によるこのような処理は、解決手段2に対応する。   However, since the mapping unit 34 has two columns “organization master.organization name” and “person master.name” corresponding to the attribute of “name” of the “Party” class 41, there is a conditional correspondence relationship. Is stored in the memory 31. The conditional correspondence relationship is stored in the memory 31 in the condition: “group master.organization name” when the class = “organization” and “person master.name” when the condition: class = “person”. Such processing by the mapping unit 34 corresponds to the solving means 2.

ここで、マッピング部34は、「Party」クラス41の汎化(汎化を扱うためのインスタンスが属するクラスの識別情報)に対応するRDBの要素がないので、クラスに対応するテーブルの主キーを外部キーとして持ち、クラス識別子の列を持つテーブルをRDBのテーブル13に追加する。追加されるテーブルは、「PartyID(団体)テーブル」55、及び、「PartyID(人)テーブル」56である。「PartyID(団体)テーブル」55では、「団体マスタ」51の主キーである「団体名」が外部キーになっている。PartyID(人)テーブル」56では、「人マスタ」53の主キーである「氏名」が外部キーになっている。マッピング部34によるこのような処理は、解決手段14に対応する。   Here, since there is no RDB element corresponding to the generalization of the “Party” class 41 (identification information of the class to which the instance for handling the generalization belongs), the mapping unit 34 uses the primary key of the table corresponding to the class. A table held as a foreign key and having a class identifier column is added to the RDB table 13. The tables to be added are a “PartyID (group) table” 55 and a “PartyID (people) table” 56. In the “PartyID (group) table” 55, the “group name” that is the primary key of the “group master” 51 is an external key. In the “PartyID (person) table” 56, the “name” that is the primary key of the “person master” 53 is an external key. Such processing by the mapping unit 34 corresponds to the solving means 14.

このように「Party」ラッパー61と「団体マスタ」51、「人マスタ」53、「PartyID(団体)テーブル」55及び「PartyID(人)テーブル」56との対応付けが行われる。これにより、図4における「Party」ラッパー61を経由した「Party」クラス41と、「団体マスタ」51、「人マスタ」53「PartyID(団体)テーブル」55及び「PartyID(人)テーブル」56との対応関係がメモリ31に格納される。   In this way, the “Party” wrapper 61 is associated with the “organization master” 51, the “person master” 53, the “PartyID (group) table” 55, and the “PartyID (person) table” 56. Accordingly, the “Party” class 41 via the “Party” wrapper 61 in FIG. 4, the “organization master” 51, the “person master” 53, the “PartyID (organization) table” 55, and the “PartyID (person) table” 56 Are stored in the memory 31.

同様にして、マッピング部34により「人」ラッパー64と「人マスタ」53とが対応付けられ、「人」ラッパー64を経由した「人」クラス44と「人マスタ」53との対応関係がメモリ31に格納される。また、マッピング部34により「活動」ラッパー65と「団体活動テーブル」52とが対応付けられ、「活動」ラッパー65を経由した「活動」クラス45及び「役職」クラス46と「団体活動テーブル」52との対応関係がメモリ31に格納される。更に、マッピング部34により「団体」ラッパー62と「団体マスタ」51とが対応付けられ、「団体」ラッパー62を経由した「団体」クラス43及び「分野」クラス42と「団体マスタ」51との対応関係がメモリ31に格納される。   Similarly, the mapping unit 34 associates the “person” wrapper 64 with the “person master” 53, and the correspondence between the “person” class 44 and the “person master” 53 via the “person” wrapper 64 is stored in the memory. 31. Further, the “activity” wrapper 65 and the “group activity table” 52 are associated with each other by the mapping unit 34, and the “activity” class 45, the “position” class 46 and the “group activity table” 52 via the “activity” wrapper 65 are associated. Is stored in the memory 31. Further, the “group” wrapper 62 and the “group master” 51 are associated with each other by the mapping unit 34, and the “group” class 43 and the “field” class 42 and the “group master” 51 passed through the “group” wrapper 62. The correspondence relationship is stored in the memory 31.

このようにマッピング部34によりRDBラッパー12とRDBのテーブル13の対応付けが行われ、図4におけるRDBラッパー12を経由したオブジェクトモデル11の要素と、RDBのテーブル13との対応関係がメモリ31に格納される。   Thus, the mapping unit 34 associates the RDB wrapper 12 with the RDB table 13, and the correspondence between the elements of the object model 11 via the RDB wrapper 12 in FIG. 4 and the RDB table 13 is stored in the memory 31. Stored.

上述のようにして生成されたRDBラッパー12(例示:「Party」ラッパー61、「人」ラッパー64、「活動」ラッパー65、「団体」ラッパー62)の動作は次のように行われる。   The operations of the RDB wrapper 12 generated as described above (example: “Party” wrapper 61, “person” wrapper 64, “activity” wrapper 65, and “organization” wrapper 62) are performed as follows.

図5は、本実施の形態に係るRDBラッパーの動作を示すフロー図である。ここでは、一例として、「Party」ラッパー61に関して説明する。マッピング部34には、Party検索メソッドに対して検索のプログラムが用意されている。
このプログラム(SQL文)は、
「SELECT {Partyインスタンスのテーブルの主キー}
FROM {Partyインスタンスが属するクラスに対応するテーブル名}
WHERE {Partyインスタンスのテーブルの主キー}
IN (SELECT {Partyインスタンスのクラス識別子のテーブルの外部キー}
FROM {Partyインスタンスのクラス識別子のテーブル}
WHERE クラス識別子=“Party種別”) AND
{「名称」の属性に対応する列}=“名称”」である。
マッピング部34により、実行時にSQL文の中括弧“{ }”内が埋められ、RDBラッパー12のPartyラッパー61によりParty検索の処理が実行される。
FIG. 5 is a flowchart showing the operation of the RDB wrapper according to the present embodiment. Here, as an example, the “Party” wrapper 61 will be described. The mapping unit 34 has a search program for the Party search method.
This program (SQL statement)
“SELECT {Primary key of the table of Party instances}
FROM {table name corresponding to class to which Party instance belongs}
WHERE {primary key of table of Party instance}
IN (SELECT {foreign key of the table of class identifiers of Party instances}
FROM {Table of class identifier of Party instance}
WHERE class identifier = “Party type”) AND
{The column corresponding to the attribute of “name”} = “name” ”.
The mapping unit 34 fills the curly braces “{}” in the SQL statement at the time of execution, and the party wrapper 61 of the RDB wrapper 12 executes the party search process.

上記動作は、「Party」クラス41を継承する「無目的集団」クラス48が追加されても同様に実行できる。図6は、本発明の実施の形態に係るRDBラッパーによるオブジェクトモデルの要素と、RDBラッパーと、RDBの要素のマッピングの他の一例を示す概略図である。本図では、図4に対して、オブジェクトモデル11に「Party」クラス41を継承する「無目的集団」クラス48が追加されている。   The above operation can be executed in the same manner even when the “unpurpose group” class 48 that inherits the “Party” class 41 is added. FIG. 6 is a schematic diagram illustrating another example of mapping of an object model element, an RDB wrapper, and an RDB element by the RDB wrapper according to the embodiment of the present invention. In this figure, an “unintended group” class 48 that inherits the “Party” class 41 is added to the object model 11 with respect to FIG.

オブジェクトモデル11に「無目的集団」クラス48が追加された場合、特開2007−249345号公報で記載されている動作により、「無目的集団」ラッパー68及び「無目的集団テーブル」58を生成しても良い。あるいは、オブジェクトモデル11に「無目的集団」クラス48が追加され、且つ、RDBのテーブル13に「無目的集団テーブル58」が追加された場合、マッピング部34は、上記の動作と同様の動作により、「無目的集団」ラッパー68を生成することができる。   When the “unintended group” class 48 is added to the object model 11, the “unintended group” wrapper 68 and the “unintended group table” 58 are generated by the operation described in Japanese Patent Application Laid-Open No. 2007-249345. May be. Alternatively, when the “unintended group” class 48 is added to the object model 11 and the “unintended group table 58” is added to the table 13 of the RDB, the mapping unit 34 performs the same operation as described above. , A “unintended population” wrapper 68 can be generated.

「Party」ラッパー61に関しては、マッピング部34は、更に、条件付の対応関係として、条件:クラス=“無目的集団”のとき「無目的集団テーブル」58、を更にメモリ31に格納する。マッピング部34によるこのような処理は、解決手段1に対応する。それにより、マッピング部34により「Party」ラッパー61と「無目的集団テーブル58」とが更に対応付けられ、「Party」ラッパー61を経由した「無目的集団」クラス48と「無目的集団テーブル」58との対応関係が更にメモリ31に格納される。   Regarding the “Party” wrapper 61, the mapping unit 34 further stores a “unpurpose group table” 58 in the memory 31 when the condition: class = “unpurpose group”, as a conditional correspondence. Such processing by the mapping unit 34 corresponds to the solving means 1. Accordingly, the mapping unit 34 further associates the “Party” wrapper 61 and the “unintended group table 58”, and the “unintended group” class 48 and the “unintended group table” 58 via the “Party” wrapper 61. Is further stored in the memory 31.

以上の結果、マッピング部34によって、図6に示すマッピングを行うだけで、Party検索メソッドに対する検索のプログラムを変更することなしに、「無目的集団」クラス48のParty検索が実行可能である。このようにオブジェクトモデルが利点として持つ変更容易性、規模低減のメリットを享受できる。   As a result, by performing the mapping shown in FIG. 6 by the mapping unit 34, the party search of the “unintended population” class 48 can be executed without changing the search program for the party search method. As described above, the object model has the advantage of easy change and the advantage of scale reduction.

一方、RDBを主とし、RDBのテーブル構造にあわせてオブジェクトモデルを決定するマッピング(例示:特表2001−518670号公報)について考える。図7は、オブジェクトモデルに「無目的集団」クラスを追加した場合のリンクとRDBテーブルとの関係を示す概念図である。図8は、図7の場合でのRDBラッパーの動作を示すシーケンス図である。図8(a)は「人」検索、図8(b)は「団体」検索、図8(c)は「無目的集団」検索をそれぞれ示す。図7に示すようにオブジェクトモデルに「無目的集団」クラスを追加した場合、RDBテーブルに「無目的集団」テーブルを追加した上で、図8(c)に示すようなシーケンス図及びそれに対応するプログラムを追加する必要があり、変更容易性、規模低減のメリットを享受できない。   On the other hand, let us consider a mapping (example: JP-T-2001-518670) that mainly uses RDB and determines an object model in accordance with the table structure of RDB. FIG. 7 is a conceptual diagram showing the relationship between the link and the RDB table when the “unintended group” class is added to the object model. FIG. 8 is a sequence diagram showing the operation of the RDB wrapper in the case of FIG. 8A shows a “person” search, FIG. 8B shows a “group” search, and FIG. 8C shows a “unintended group” search. When the “unintended group” class is added to the object model as shown in FIG. 7, the “unintended group” table is added to the RDB table, and the sequence diagram as shown in FIG. It is necessary to add a program, and the benefits of ease of change and scale reduction cannot be enjoyed.

図9は、シーケンスの処理の一例を示すシーケンス図である。図9のようなシーケンスの処理について、オブジェクトモデルに完全に一致させたカプセル化を行った場合には、シーケンス図上のメッセージに合わせて複数回のSQL文が必要となり、要求される高速な処理性能を実現できない。しかし、本発明では「SELECT 団体名 FROM 団体マスタ WHERE 分野名=“分野名”」という1回のSQL文で実行可能なため要求される性能を実現できる。   FIG. 9 is a sequence diagram illustrating an example of a sequence process. For the processing of the sequence as shown in FIG. 9, when encapsulation is performed that completely matches the object model, a plurality of SQL statements are required according to the message on the sequence diagram, and the required high-speed processing Unable to achieve performance. However, in the present invention, since it can be executed with a single SQL statement “SELECT organization name FROM organization master WHERE field name =“ field name ””, the required performance can be realized.

本発明では、所与のオブジェクトモデルに対してそのインスタンスの永続化に用いるRDBの構造が決定済みの制約である場合でも、オブジェクトモデルの変更容易性を維持したまま許容可能な性能で動作することが出来る。その理由は、所与のオブジェクトモデルの各要素と所与のRDBの各要素を対応付ける構成と、レコード追加・削除処理部35を含むその対応関係に従ってシステムを動作させるために必要な構成を持っているからである。   In the present invention, even when the structure of the RDB used for persisting an instance of a given object model is a determined constraint, the object model operates with acceptable performance while maintaining the changeability of the object model. I can do it. The reason is that there is a configuration for associating each element of a given object model with each element of a given RDB, and a configuration necessary for operating the system according to the corresponding relationship including the record addition / deletion processing unit 35. Because.

本発明により、RDBの構造が決定済みの制約である場合にも利用可能でオブジェクトモデルの利点を生かすことが可能なマッピング装置、マッピング方法およびプログラムを提供することができる。   According to the present invention, it is possible to provide a mapping apparatus, a mapping method, and a program that can be used even when the structure of the RDB is a determined constraint and can take advantage of the object model.

図1は本実施の形態に係るマッピング装置の構成を示すブロック図である。FIG. 1 is a block diagram showing the configuration of the mapping apparatus according to the present embodiment. 図2は本発明の実施の形態に係るオブジェクトモデルの一例を示す概略図である。FIG. 2 is a schematic diagram showing an example of an object model according to the embodiment of the present invention. 図3は本発明の実施の形態に係るRDBのテーブルの一例を示す概略図である。FIG. 3 is a schematic diagram showing an example of an RDB table according to the embodiment of the present invention. 図4は本発明の実施の形態に係るRDBラッパーによるオブジェクトモデルの要素と、RDBラッパーと、RDBの要素のマッピングの一例を示す概略図である。FIG. 4 is a schematic diagram showing an example of mapping of an object model element, an RDB wrapper, and an RDB element by the RDB wrapper according to the embodiment of the present invention. 図5は本実施の形態に係るRDBラッパーの動作を示すシーケンス図である。FIG. 5 is a sequence diagram showing the operation of the RDB wrapper according to the present embodiment. 図6は本発明の実施の形態に係るRDBラッパーによるオブジェクトモデルの要素と、RDBラッパーと、RDBの要素のマッピングの他の一例を示す概略図である。FIG. 6 is a schematic diagram showing another example of mapping of an object model element, an RDB wrapper, and an RDB element by the RDB wrapper according to the embodiment of the present invention. 図7は、オブジェクトモデルに「無目的集団」クラスを追加した場合のリンクとRDBテーブルとの関係を示す概念図である。FIG. 7 is a conceptual diagram showing the relationship between the link and the RDB table when the “unintended group” class is added to the object model. 図8は図7の場合でのRDBラッパーの動作を示すシーケンス図である。FIG. 8 is a sequence diagram showing the operation of the RDB wrapper in the case of FIG. 図9はシーケンスの処理の一例を示すシーケンス図である。FIG. 9 is a sequence diagram illustrating an example of sequence processing.

符号の説明Explanation of symbols

1 要素格納部
2 リレーショナルデータベース(RDB)格納部
3 処理部
10、10a〜10c オブジェクトモデルの要素
11 オブジェクトモデル
12 処理部(RDBラッパー)
13 RDBのテーブル
20、20a〜20c RDBの要素
31 メモリ
32 受付部
33 選択部
34 マッピング部
35 行追加・削除処理部
41 Partyクラス
42 分野クラス
43 団体クラス
44 人クラス
45 活動クラス
46 役職クラス
48 無目的集団
51 団体マスタ
52 団体活動テーブル
53 人マスタ
55 PartyID(団体)テーブル
56 PartyID(人)テーブル
58 無目的集団テーブル
61 Partyラッパー
62 人ラッパー
64 団体ラッパー
65 活動ラッパー
68 無目的集団ラッパー
100、100−1、100−2 マッピング装置
DESCRIPTION OF SYMBOLS 1 Element storage part 2 Relational database (RDB) storage part 3 Processing part 10, 10a-10c Object model element 11 Object model 12 Processing part (RDB wrapper)
13 RDB table 20, 20a to 20c RDB element 31 Memory 32 Reception unit 33 Selection unit 34 Mapping unit 35 Row addition / deletion processing unit 41 Party class 42 Field class 43 Group class 44 Person class 45 Activity class 46 Job class 48 None Target Group 51 Group Master 52 Group Activity Table 53 Person Master 55 PartyID (Group) Table 56 PartyID (Person) Table 58 Unpurposed Group Table 61 Party Wrapper 62 Person Wrapper 64 Group Wrapper 65 Activity Wrapper 68 Unpurposed Group Wrapper 100, 100- 1, 100-2 mapping device

Claims (10)

オブジェクトモデルの複数の第1要素を格納する要素格納部と、
リレーショナルデータベースの複数の第2要素を格納するRDB格納部と、
前記リレーショナルデータベースの構造が決定済みの制約である場合、前記複数の第1要素から選択された第3要素に対して、前記複数の第2要素のうちの第4要素との間に対応関係が成り立つ場合の条件を識別し、前記条件付きの前記対応関係を含むマッピングを生成するマッピング部と
を具備する
マッピング装置。
An element storage for storing a plurality of first elements of the object model;
An RDB storage for storing a plurality of second elements of a relational database;
In the case where the structure of the relational database is a determined constraint, there is a correspondence relationship between the third element selected from the plurality of first elements and the fourth element of the plurality of second elements. A mapping unit that identifies a condition in a case where the condition is satisfied and generates a mapping including the correspondence with the condition.
請求項1に記載のマッピング装置において、
前記マッピング部は、前記リレーショナルデータベースの構造が決定済みの制約である場合、前記複数の第2要素の中に前記第3要素に対して対応関係が成り立つものが無いとき、前記第3要素に対応付けた新たな要素を前記複数の第2要素に追加する
マッピング装置。
The mapping device according to claim 1,
When the structure of the relational database is a determined constraint, the mapping unit corresponds to the third element when none of the plurality of second elements has a corresponding relationship with the third element. A mapping device for adding the added new element to the plurality of second elements.
オブジェクトモデルの複数の第1要素を格納する要素格納部と、
リレーショナルデータベースの複数の第2要素を格納するRDB格納部と、
前記リレーショナルデータベースの構造が決定済みの制約である場合、前記複数の第1要素から選択された第3要素に対して、前記複数の第2要素の中に対応関係が成り立つものが無いとき、前記第3要素に対応付けた新たな要素を前記複数の第2要素に追加してマッピングを生成するマッピング部と
を具備する
マッピング装置。
An element storage for storing a plurality of first elements of the object model;
An RDB storage for storing a plurality of second elements of a relational database;
When the relational database structure is a determined constraint, when there is no correspondence among the plurality of second elements with respect to the third element selected from the plurality of first elements, A mapping device comprising: a mapping unit that generates a mapping by adding a new element associated with a third element to the plurality of second elements.
請求項1乃至3のいずれか一項に記載のマッピング装置において、
前記複数の第1要素の各々は、クラス、限定子、関連、及び汎化のいずれか一つ又はいずれか一つのインスタンスを含み、
前記複数の第2要素の各々は、テーブル、前記テーブルの行、及びテーブルの列のいずれか一つ又はいずれか一つの値を含む
マッピング装置。
The mapping device according to any one of claims 1 to 3,
Each of the plurality of first elements includes any one or any one instance of a class, a qualifier, an association, and a generalization,
Each of the plurality of second elements includes any one or any one value of a table, a row of the table, and a column of the table.
オブジェクトモデルの複数の第1要素及びリレーショナルデータベースの複数の第2要素を参照するステップと、
前記リレーショナルデータベースの構造が決定済みの制約である場合、前記複数の第1要素から選択された第3要素に対して、前記複数の第2要素のうちの第4要素との間に対応関係が成り立つ場合の条件を識別するステップと、
前記条件付きの前記対応関係を含むマッピングを生成するステップと
を具備する
マッピング方法。
Referencing a plurality of first elements of an object model and a plurality of second elements of a relational database;
In the case where the structure of the relational database is a determined constraint, there is a correspondence relationship between the third element selected from the plurality of first elements and the fourth element of the plurality of second elements. Identifying a condition if satisfied;
Generating a mapping including the correspondence with the condition.
請求項5に記載のマッピング方法において、
前記リレーショナルデータベースの構造が決定済みの制約である場合、前記複数の第2要素の中に前記第3要素に対して対応関係が成り立つものが無いとき、前記第3要素に対応付けた新たな要素を前記複数の第2要素に追加するステップを更に具備する
マッピング方法。
The mapping method according to claim 5,
If the relational database structure is a determined constraint, a new element associated with the third element when there is no corresponding relationship with the third element among the plurality of second elements A mapping method further comprising: adding to the plurality of second elements.
オブジェクトモデルの複数の第1要素及びリレーショナルデータベースの複数の第2要素を参照するステップと、
前記リレーショナルデータベースの構造が決定済みの制約である場合、前記複数の第1要素から選択された第3要素に対して、前記複数の第2要素の中に対応関係が成り立つものが無いとき、前記第3要素に対応付けた新たな要素を前記複数の第2要素に追加してマッピングを生成するステップと
を具備する
マッピング方法。
Referencing a plurality of first elements of an object model and a plurality of second elements of a relational database;
When the relational database structure is a determined constraint, when there is no correspondence among the plurality of second elements with respect to the third element selected from the plurality of first elements, Adding a new element associated with a third element to the plurality of second elements to generate a mapping.
マッピング部が、オブジェクトモデルの複数の第1要素を格納する要素格納部と、リレーショナルデータベースの複数の第2要素を格納するRDB格納部とを参照するステップと、
前記マッピング部が、前記リレーショナルデータベースの構造が決定済みの制約である場合、前記複数の第1要素から選択された第3要素に対して、前記複数の第2要素のうちの第4要素との間に対応関係が成り立つ場合の条件を識別するステップと、
前記マッピング部が、前記条件付きの前記対応関係を含むマッピングを生成するステップと
を具備するマッピング方法をコンピュータに実行させるためのプログラム。
A step of referring to an element storage unit that stores a plurality of first elements of an object model and an RDB storage unit that stores a plurality of second elements of a relational database;
When the mapping unit is a constraint whose structure of the relational database has been determined, a third element selected from the plurality of first elements is compared with a fourth element of the plurality of second elements. Identifying a condition when a correspondence relationship is established between,
A program for causing a computer to execute a mapping method, wherein the mapping unit includes a step of generating a mapping including the conditional correspondence.
請求項8に記載のプログラムにおいて、
前記マッピング部が、前記リレーショナルデータベースの構造が決定済みの制約である場合、前記複数の第2要素の中に前記第3要素に対して対応関係が成り立つものが無いとき、前記第3要素に対応付けた新たな要素を前記複数の第2要素に追加するステップを更に具備するマッピング方法をコンピュータに実行させるためのプログラム。
The program according to claim 8, wherein
When the mapping unit is a constraint whose structure of the relational database has been determined, and when there is no correspondence relationship with the third element among the plurality of second elements, it corresponds to the third element A program for causing a computer to execute a mapping method further comprising the step of adding a new element added to the plurality of second elements.
マッピング部が、オブジェクトモデルの複数の第1要素を格納する要素格納部と、リレーショナルデータベースの複数の第2要素を格納するRDB格納部とを参照するステップと、
前記マッピング部が、前記リレーショナルデータベースの構造が決定済みの制約である場合、前記複数の第1要素から選択された第3要素に対して、前記複数の第2要素の中に対応関係が成り立つものが無いとき、前記第3要素に対応付けた新たな要素を前記複数の第2要素に追加してマッピングを生成するステップと
を具備するマッピング方法をコンピュータに実行させるためのプログラム。
A step of referring to an element storage unit that stores a plurality of first elements of an object model and an RDB storage unit that stores a plurality of second elements of a relational database;
When the mapping unit is a constraint whose structure of the relational database has been determined, a correspondence relationship is established in the plurality of second elements with respect to the third element selected from the plurality of first elements. A program for causing a computer to execute a mapping method, comprising: adding a new element associated with the third element to the plurality of second elements when there is no mapping, and generating a mapping.
JP2008067826A 2008-03-17 2008-03-17 Mapping unit, mapping method and program Pending JP2009223644A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008067826A JP2009223644A (en) 2008-03-17 2008-03-17 Mapping unit, mapping method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008067826A JP2009223644A (en) 2008-03-17 2008-03-17 Mapping unit, mapping method and program

Publications (1)

Publication Number Publication Date
JP2009223644A true JP2009223644A (en) 2009-10-01

Family

ID=41240342

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008067826A Pending JP2009223644A (en) 2008-03-17 2008-03-17 Mapping unit, mapping method and program

Country Status (1)

Country Link
JP (1) JP2009223644A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08161208A (en) * 1994-12-08 1996-06-21 Fujitsu Ltd Object structure converter
JP2000148555A (en) * 1998-11-13 2000-05-30 Toppan Printing Co Ltd Mapping method between object model and relational model
JP2001518670A (en) * 1997-09-26 2001-10-16 オントス,インコーポレイテッド Objective model mapping and runtime engine for using a relational database with object-oriented software
JP2007249345A (en) * 2006-03-14 2007-09-27 Nec Corp Mapping device, mapping method and program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08161208A (en) * 1994-12-08 1996-06-21 Fujitsu Ltd Object structure converter
JP2001518670A (en) * 1997-09-26 2001-10-16 オントス,インコーポレイテッド Objective model mapping and runtime engine for using a relational database with object-oriented software
JP2000148555A (en) * 1998-11-13 2000-05-30 Toppan Printing Co Ltd Mapping method between object model and relational model
JP2007249345A (en) * 2006-03-14 2007-09-27 Nec Corp Mapping device, mapping method and program

Similar Documents

Publication Publication Date Title
JP4856627B2 (en) Partial query caching
US9128996B2 (en) Uniform data model and API for representation and processing of semantic data
US9197597B2 (en) RDF object type and reification in the database
JP4809652B2 (en) . NET data types and instance persistent storage
US7480661B2 (en) Query services for database system
US8874619B2 (en) Method and apparatus for defining common entity relationships
US20190138522A1 (en) Query translation for searching complex structures of objects
US8037039B2 (en) Runtime class database operation
US20100049692A1 (en) Apparatus and Method For Retrieving Information From An Application Functionality Table
KR20060045924A (en) Impact analysis in an object model
US20080016048A1 (en) Intelligent condition pruning for size minimization of dynamic, just in time tables
US8175997B2 (en) Method of applying user-defined inference rule using function of searching knowledge base and knowledge base management system therefor
KR100529661B1 (en) Object integrated management system
Singh et al. SQL2Neo: Moving health-care data from relational to graph databases
US20040078355A1 (en) Information management system
CN100397397C (en) XML data storage and access method based on relational database
US8433729B2 (en) Method and system for automatically generating a communication interface
JP5287071B2 (en) Database management system and program
CN112783915A (en) Data transmission object mapping method and unit based on SpringMVC + Mybatis framework
CN116049193A (en) Data storage method and device
CN109376154A (en) Reading data, wiring method and reading data, writing system
CN109753533A (en) A kind of multi-source relevant database client development approach and device
JP2009223644A (en) Mapping unit, mapping method and program
CN101093495B (en) Data processing method and system based on network relation dimension
CN107636652A (en) RDB systems

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110920

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110928

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20120314