我已經SQL表繼承這種方式來實現:斯卡拉油滑表繼承
Table Shape:
Column | Type
------------+---------
shape_id | integer
square | foat
name | character varying(64)
Table Triangle
Column | Type
------------+---------
shape_id | integer
a | float
b | float
c | float
Foreign-key constraints:
"fkey1" FOREIGN KEY (shape_id) REFERENCES Shape(shape_id)
Table Circle
Column | Type
------------+---------
shape_id | integer
r | float
Foreign-key constraints:
"fkey2" FOREIGN KEY (shape_id) REFERENCES Shape(shape_id)
是否有可能用油滑創造一流的模型,其中三角延伸的部分和圓延伸的部分?
我看到this question,但我不喜歡這樣一種方法,即所有派生表列都可以將一個表放置爲可爲空。
謝謝!
所有parleys鏈接都已死,無法在youtube上找到 – Intracer