一份保单可以同时涵盖多个保险对象和多个当事方的协议。实例,一项策略可能涉及许多参与方,并且每一方都可能是多个策略的一部分。这会导致角色和协议之间形成多对多关系。
与“参与方”域类似,您可以通过为关系数据库中的每个表添加映射,将此信息嵌入到MongoDB policy
文档中。
策略域包括以下关键实体:
投保对象:由保单协议投保的对象。
保险对象方角色:链接以下实体的关联实体:
协议方角色:链接以下实体的关联实体:
下图显示了策略域的实体关系图 (ERD):
单击 Mappings from relational tables 旁边的 Add。单击 Embedded array,然后从 Source table 下拉菜单中选择 policy_party_role。
在 All fields 复选框下,取消选中 policyIdentifier
字段,然后单击 Save and close。
在 Mappings from relational tables 旁边,单击 Add 并选择 Embedded documents。从 Source table 下拉菜单中选择 agreement。
单击 Save and close(连接)。
在 Mappings from relational tables 旁边,单击 Add 并选择 Embedded array。从 Source table 下拉菜单中选择 policy_coverage_part。
在 All fields 复选框下,取消选中 policyIdentifier
字段,然后单击 Save and close。
每个覆盖部分的详细信息都包含在 policy_coverage_detail
表中。要嵌入此信息,请单击 Add 并选择 Embedded array。从 Source table 下拉菜单中选择 policy_coverage_detail,并确保 Root path 前缀为 policyCoverageParts
。
在 All fields 复选框下,取消选中 policyIdentifier
和 coveragePartCode
字段,然后单击 Save and close。
要包含 insurable_object
集合中的覆盖率信息,请单击 Add 并选择 Embedded documents。从 Source table 下拉菜单中选择 insurable_object。
单击 Save and close(连接)。
要包含 policy_limit
信息,请单击 Add 并选择 Embedded array。从 Source table 下拉菜单中选择 policy_limit,并确保 Root path 前缀为 policyCoverageParts
。
在 All fields 复选框下,取消选中 policyCoverageDetailIdentifier
字段,然后单击 Save and close。
对 policy_deductible
重复该进程。
保险对象具有额外的关系,用于指定解决和不同参与方所扮演的角色。要包含此信息,请单击 Add 并选择 Embedded array。从 Source table 下拉菜单中选择 insurable_object_party_role。
在 All fields 复选框下,取消选中 insurableObjectIdentifier
字段,然后单击 Save and close。
将所有必要的表映射到 policy
集合后,您就可以从Relational Migrator的MongoDB视图中删除以下集合:
agreement
policyPartyRole
policyCoveragePart
policyCoverageDetail
policyDeductible
policyLimit
映射策略域后,以类似方式重构声明域。请参阅重构声明域。