JDL:多个菜单

时间:2019-05-22 08:06:57

标签: database spring-boot jhipster jdl

我试图使用JDL创建多个菜单类别。在一个CategoryItem中有parentID。

我已经创建了JDL,例如:

microservice * with Category

entity CategoryItem{
    name String required
}

relationship ManyToOne{
    CategoryItem{parrent} to CategoryItem
} 

service * with serviceClass
paginate CategoryItem with pagination

如果客户端调用方法findAll。我可以返回这样的JSON格式吗?

[
  {
    "id": 1,
    "name": "car",
    "CategoryItem": [
      {
        "id": 2,
        "name": "red car"
      },
      {
        "id": 3,
        "name": "blue car"
      }
    ]
  },
  {
    "id": 4,
    "name": "bike",
    "CategoryItem": []
  }
]

0 个答案:

没有答案