jhipster - jHipster, generated DTO does not contain related Child DTOs
问题描述
Use case: I would like to call a top level (parent) DTO that returns nested children DTO objects.
Example entities:
entity Person {
firstName String
lastName String
}
entity Dog {
petName String
}
relationship OneToMany {
Person{dog} to Dog{person required}
}
The generated PersonDTO does not include the DogDTO. I would like it to return the following:
{
"id": 1,
"firstName": "John",
"lastName": "Doe",
"dogs":
[
{
"id": 1
"petName": "Fido"
},
{
"id": 2
"petName": "Spot"
}
]
}
Thank you
解决方案
推荐阅读
- sql - 如何阻止我的 Postgres recusive CTE 无限循环?
- payumoney - 在 PayU India 测试 UPI 和 Netbanking 付款方式的测试帐户是什么
- javascript - 使用来自另一个对象 VueJs 的数据
- react-native - 我的代码有什么问题。图像未在本机反应中发送上传到服务器
- c++ - 使用回调来使用来自 std::vector 的数据
- maven - Jenkins 无法保存新的或编辑现有的 Maven 项目配置
- php - 如何在 Symfony 中处理来自 html 表单的请求?
- flutter - 带有粘性侧标题的 ListView
- python - 构建代码期间的 Python 版本不匹配
- c++ - 我可以创建具有相同名称的 C++ 线程吗?