How to ensure data integrity when using Table Per Subclass?
如何确保数据完整性在使用每个子类表吗?
For our first strategy (one table per subclass), Hibernate will read multiple tables each time an object is instantiated and populated.
对于第一个策略(每个子类一个表),Hibernate每次初始化和填充对象时,会读取多个表。
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.
按类表:(可选)每个具体的子类映射到一个表,并且包含超类属性的列。
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模型中时,这种被“切掉”的现象就会发生。
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模型中时,这种被“切掉”的现象就会发生。
应用推荐