batchQueryRelatedObjects
功能介绍
batchQueryRelatedObjects接口可根据入参,批量查询某源/目标数据模型的信息以及对应的属性列表。
例如,入参为源数据模型,可批量查询目标数据模型信息和属性。
入参
{ "params":{ "objectIds": [ "XXXX", "XXXX" ], "role":"source", "latestOnly":false } }
- objectIds:对象ID列表。
- role:角色,源数据模型或目标数据模型。
- latestOnly:目标对象是否仅返回源对象关联的最新版本目标对象,默认为false。(仅对M-V模型有效,即返回所有版本)
出参
返回查询结果列表。
示例场景
假设有一个源端为RelationLeft,目标端为RelationRight的关系实体(RelationTest)。其中,
- RelationLeft有两个关系实例,唯一编码为454580805678901111和454580805678902222。
- RelationRight有两个关系实例,唯一编码为454580805678903333和454580805678904444。
并创建了如下唯一编码的关系实例:
- 1313:源端为454580805678901111,目标端为454580805678903333。
- 2424:源端为454580805678902222,目标端为454580805678904444。
- 1414:源端为454580805678901111,目标端为454580805678904444。
入参示例
根据源端RelationLeft的ID为454580805678901111和454580805678902222的对象实例查询符合条件的目标端对象实例。
{ "params":{ "objectIds": [ "454580805678901111", "454580805678902222" ], "role":"source", "latestOnly":false } }
出参示例
{ "result": "SUCCESS", "data": [ { "objectId": "454580805678902222", "relatedList": [ { "id": "454580805678904444", "creator": "xdm_pub_validation f9828b63ee074aa69a2b3fb30aXXXXXX", "createTime": "2023-01-12T11:55:47.918+0000", "modifier": "xdm_pub_validation f9828b63ee074aa69a2b3fb30aXXXXXX", "lastUpdateTime": "2023-01-12T11:55:47.918+0000", "rdmExtensionType": "RelationRight", "tenant": { "id": "-1", "creator": "xdmAdmin", "createTime": "2022-09-22T04:10:48.543+0000", "modifier": "xdmAdmin", "lastUpdateTime": "2022-09-22T04:10:48.543+0000", "rdmExtensionType": "Tenant", "tenant": null, "className": "Tenant", "name": "basicTenant", "description": "默认租户", "code": "basicTenant", "disableFlag": false, "dataSource": "DefaultDataSource" }, "className": "RelationRight", "name": null, "description": null } ] }, { "objectId": "454580805678901111", "relatedList": [ { "id": "454580805678903333", "creator": "xdm_pub_validation f9828b63ee074aa69a2b3fb30aXXXXXX", "createTime": "2023-01-12T11:55:43.192+0000", "modifier": "xdm_pub_validation f9828b63ee074aa69a2b3fb30aXXXXXX", "lastUpdateTime": "2023-01-12T11:55:43.192+0000", "rdmExtensionType": "RelationRight", "tenant": { "id": "-1", "creator": "xdmAdmin", "createTime": "2022-09-22T04:10:48.543+0000", "modifier": "xdmAdmin", "lastUpdateTime": "2022-09-22T04:10:48.543+0000", "rdmExtensionType": "Tenant", "tenant": null, "className": "Tenant", "name": "basicTenant", "description": "默认租户", "code": "basicTenant", "disableFlag": false, "dataSource": "DefaultDataSource" }, "className": "RelationRight", "name": null, "description": null }, { "id": "454580805678904444", "creator": "xdm_pub_validation f9828b63ee074aa69a2b3fb30aXXXXXX", "createTime": "2023-01-12T11:55:47.918+0000", "modifier": "xdm_pub_validation f9828b63ee074aa69a2b3fb30aXXXXXX", "lastUpdateTime": "2023-01-12T11:55:47.918+0000", "rdmExtensionType": "RelationRight", "tenant": { "id": "-1", "creator": "xdmAdmin", "createTime": "2022-09-22T04:10:48.543+0000", "modifier": "xdmAdmin", "lastUpdateTime": "2022-09-22T04:10:48.543+0000", "rdmExtensionType": "Tenant", "tenant": null, "className": "Tenant", "name": "basicTenant", "description": "默认租户", "code": "basicTenant", "disableFlag": false, "dataSource": "DefaultDataSource" }, "className": "RelationRight", "name": null, "description": null } ] } ], "errors": [], "pageInfo": { "curPage": 1, "pageSize": 20, "totalRows": 3, "totalPages": 1 } }