mraible / jhipster7-demo

JHipster 7 Demo! 🔥
Apache License 2.0
81 stars 44 forks source link

ManyToMany and UI generation #6

Closed pasqualebasile closed 2 years ago

pasqualebasile commented 2 years ago

Hi, I'm interested in UI generation when in JDL is present a ManyToMany relationship. In this demo exists this specification:

relationship ManyToMany {
  Post{tag(name)} to Tag{post}
}

The UI generated presents, in the Post view, a multiselect widget for selecting as many tags I want. But, on the other side, in the Tag management view, there's no code generated for the post linked in the relationship.

Neverthless, after generate the application (without the Business Logic steps, and with fake data), and generate some relation between posts and tags, I obtain the following behaviour: For the request http://localhost:8080/api/posts/1, the response is:

{
  "id": 1,
  "title": "Singapore Pavia",
  "content": "JHipster is a development platform to generate, develop and deploy Spring Boot + Angular / React / Vue Web applications and Spring microservices.",
  "date": "2021-10-10T19:54:00Z",
  "blog": {
    "id": 1,
    "name": "Integration",
    "handle": "Avon Cambridgeshire"
  },
  "tags": [
    {
      "id": 1,
      "name": "Branding back-end Sfida"
    },
    {
      "id": 2,
      "name": "Progetto composita Car"
    }
  ]
}

On the other side, for the request http://localhost:8080/api/tags/1:

{
  "id": 1,
  "name": "Branding back-end Sfida",
  "posts": null
}

What is wrong? :-o

mraible commented 2 years ago

I believe this is "as designed" because Tag has a many-to-many relationship with Post. If you think this should be changed, please provide steps to reproduce, and your reasons for wanting this in JHipster's main issue tracker.

pasqualebasile commented 2 years ago

Thanks, @mraible, I will try to write down some notes and steps in a couple of days.