我将在以下环境中将我的employee
映射到其父实体employeeLeaveApprovers
。根据文档,我尝试使用leftJoinAndMapMany
方法,但无法获得预期的结果
默认结果数据
"employeeLeaveApprovers": [
{
"id": 56,
"createdAt": "2018-07-03T01:52:41.960Z",
"updatedAt": "2018-07-03T01:52:41.960Z",
"createdBy": 1,
"updatedBy": null,
"state": 1,
"version": 1,
"approverId": 2,
"required": true,
"employee": {
"id": 2,
"firstName": "heng",
"lastName": "Sopheak"
}
}
];
期望结果
"employeeLeaveApprovers": [
{
"id": 56,
"createdAt": "2018-07-03T01:52:41.960Z",
"updatedAt": "2018-07-03T01:52:41.960Z",
"createdBy": 1,
"updatedBy": null,
"state": 1,
"version": 1,
"approverId": 2,
"required": true,
"firstName": "heng",
"lastName": "Sopheak"
}
];