Inheritance strategy

          There are three kinds of basic strategies for inheritence mapping:
          1. table per hierarchy.
          2. table per subclass.
          3. table per concreteclass.

          Table structure maybe the root reason to determine which kind strategy will be used.

          Table per hierarchy:
          With subclass element.
          A discriminator column will be used to distinguish subclass.
          Limitation: no not null constraint on sub class's property.
          Fault: redandance data will be generated.

          Table per subclass:
          With joined-class elment.
          There are tables for super class and each subclass, for every subclass, key elemnt is used to referenced to super class's primary key, and all common properties will be stored in super table. The relation between super table and sub table is one-to-one.
          Fault: complex table structure.


          Table per concrete class:
          With union-class elemnt.
          Super class responsible for genrate id and all common properties wich will stored in sub table.
          Fault: redandance data will be generated.
          Limitation: all common column should used the same column name for the properties are defined in super class.

          posted on 2007-06-01 10:55 Sheldon Sun 閱讀(264) 評(píng)論(0)  編輯  收藏


          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          <2007年6月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          1234567

          導(dǎo)航

          統(tǒng)計(jì)

          常用鏈接

          留言簿(3)

          隨筆檔案

          文章檔案

          搜索

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 杂多县| 庆安县| 南木林县| 奉节县| 洛浦县| 香港| 长武县| 南昌县| 砚山县| 大化| 柳林县| 延寿县| 长兴县| 霍州市| 闸北区| 忻州市| 康马县| 安化县| 五大连池市| 金湖县| 阿拉善右旗| 高雄市| 普安县| 繁峙县| 梁河县| 武宁县| 龙里县| 阿拉善右旗| 伊春市| 开平市| 遵化市| 会同县| 嵩明县| 泽普县| 商都县| 曲周县| 康平县| 东明县| 明溪县| 靖江市| 汤原县|