OneToManyRelationshipMetadata 类
一对多实体关系的元数据。
构造函数
OneToManyRelationshipMetadata(schema_name: str, referenced_entity: str, referencing_entity: str, referenced_attribute: str, cascade_configuration: ~PowerPlatform.Dataverse.models.relationship.CascadeConfiguration = <factory>, referencing_attribute: str | None = None, additional_properties: ~typing.Dict[str, ~typing.Any] | None = None)
参数
| 名称 | 说明 |
|---|---|
|
schema_name
必需
|
关系的架构名称(例如“new_Account_Orders”)。 |
|
referenced_entity
必需
|
引用的(父)实体的逻辑名称。 |
|
referencing_entity
必需
|
引用(子)实体的逻辑名称。 |
|
referenced_attribute
必需
|
引用实体的属性(通常是主键)。 |
|
cascade_configuration
|
级联行为配置。 默认值: <factory>
|
|
referencing_attribute
|
引用属性(通常自动生成)的可选名称。 默认值: None
|
|
additional_properties
|
要包含在 Web API 有效负载中的其他属性的可选听写。 用于设置继承的属性,例如“IsValidForAdvancedFind”、“IsCustomizable”、“SecurityTypes”等。这些是最后合并的,可以替代默认值。 默认值: None
|
方法
| to_dict |
转换为 Web API JSON 格式。 例:
|
to_dict
转换为 Web API JSON 格式。
例:
>>> rel = OneToManyRelationshipMetadata(
... schema_name="new_account_orders",
... referenced_entity="account",
... referencing_entity="new_order",
... referenced_attribute="accountid"
... )
>>> rel.to_dict()
{
'@odata.type': 'Microsoft.Dynamics.CRM.OneToManyRelationshipMetadata',
'SchemaName': 'new_account_orders',
'ReferencedEntity': 'account',
'ReferencingEntity': 'new_order',
'ReferencedAttribute': 'accountid',
'CascadeConfiguration': {...}
}
to_dict() -> Dict[str, Any]
属性
additional_properties
additional_properties: Dict[str, Any] | None = None
cascade_configuration
cascade_configuration: CascadeConfiguration
referenced_attribute
referenced_attribute: str
referenced_entity
referenced_entity: str
referencing_attribute
referencing_attribute: str | None = None
referencing_entity
referencing_entity: str
schema_name
schema_name: str