Inheritance: Annotations — Single table, joined table, and table per class.
继承:标注——单个表、联合表和按类表。
For our second strategy (one table per class hierarchy), you'll have to define your integrity using check constraints.
对于第二个策略(每个类层次结构一个表),您必须用检测约束定义您自己的完整性。
With this approach you create one table per class, the attributes of which are the OID and the attributes that are specific to that class.
使用这种方法,为每个类创建一张表,它的属性是OID和特定于该类的属性。
Mixing strategies such as "Table per Subclass" embedded in "Table per class Hierarchy" so that you can take advantages of different strategies.
采用混合策略,例如“每个类层次一张表”中嵌入“每个子类一张表”,这样可以利用不同策略的优势。
Table per-class: (Optional) Each concrete subclass is mapped to a table and contains columns for super class attributes.
按类表:(可选)每个具体的子类映射到一个表,并且包含超类属性的列。
You estimate a day to write each database access class and unit test it, so 150 tables at one table per day is 150 days.
估计您每天能编写一个数据库访问类并完成其单元测试,因此,150 个表要用 150天的时间。
"Table per Concrete Class using implicit Polymorphism" is not recommended due to its verbose configurations, complex association syntax using "any" element and potentially dangerous implicit queries.
“使用隐式多态实现每个具体类一张表”这种做法并不推荐,因为其配置过于繁缛、使用“any”元素的复杂关联语法和隐式查询的潜在危险性。
Strategy 3: One table per concrete class (Estates).
策略3:每个具体类一个表(estates)。
Table per Concrete Class using Implicit polymorphism.
4使用隐式多态实现每个具体类一张表。
Our third and last strategy is probably the most imaginative of all: having one table per concrete class and none for the Estate abstract superclass.
我们的第三个,也是最后一个策略可能是三个策略当中最有想象力的:每个具体类一个表,抽象超类estate没有表。
The parts of Person that are stored in Employee aren't "sliced off," as can happen in a regular SQL query that fails to join every derived subclass table in a table-per-class model.
存储在Employee中的Person的各部分不会被“切掉”,而当定期SQL查询未能成功地将派生子类表加入到table - per - class模型中时,这种被“切掉”的现象就会发生。
Table per Type (TPT): This approach suggests a separate table for each domain class.
这个方式,推荐给每一个领域类创建一个单独的表。
The table is built on a per-class basis, not for each instance of the class.
表是基于类构造,不是基于实例构造。
The table is built on a per-class basis, not for each instance of the class.
表是基于类构造,不是基于实例构造。
应用推荐