Closed hepaestus closed 10 months ago
This issue is stale because it has been open 30 days with no activity. Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted. We are accepting PRs :smiley:. Comment or this will be closed in 7 days
This issue is stale because it has been open for too long without any activity. Due to the moving nature of jhipster generated application, bugs can become invalid. If this issue still applies please comment otherwise it will be closed in 7 days
Overview of the issue
In many projects I am trying to create bi-directional relationships and they are not behaving as I expect them to. My understanding is probably the whole problem here but I think I am justified in not understanding what is happening under the hood here. When I see that relationships are bidirectional, I assume some things such as:
I have created a test project to replicate my issues. I hope I am not doing something weird or wrong. I want to thank You for taking time to look at this.
Motivation for or Use Case
I am confused about what syntax produces what results. If someone could be clearer in the documentation it would be great. For Example, in the test project, I have an Author object the can have many books. The Book should be able to KNOW their Author which should have a Set of books (ie. Bi-Directional).
The above JDL works as I expect with the exception that the Author does not list their books on the detail page. No queries are created for the Author object to have the books in the Repository file. Am I missing something here?
File: src/main/java/com/hepaestus/testproject/repository/AuthorRepository.java
None of the generated Queries return the books related to the author. Nor is there a query created to look up all books by an author id. See the generated details page here: ![Details Page](https://user-images.githubusercontent.com/175176/122465657-5b581a80-cf86-11eb-9dda-790849f7583b.png)Reproduce the error
See this test Project to Reproduce: https://github.com/hepaestus/testproject
Related issues
NO SURE
Suggest a Fix
On thing that would be awesome is if someone who better understands how relationships work in JH would write better documentation on relationship syntax in JDL. Better documentation of how the JDL syntax effects the generated features would be super helpful and probably reduce the number of questions. Right now it is not comprehensive and in various different locations. For example in the JDL examples repo [https://github.com/jhipster/jdl-samples] there are plenty examples however none that are documented. There is no mention of what the syntax is expected to achieve. Or why a particular syntax was used instead of another. This would be super helpful.
JHipster Version(s)
7.0.1
JHipster configuration, a
.yo-rc.json
file generated in the root folder.yo-rc.json file
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions
Here is the Dog Details Page: Notice it does not Display the Owner
Environment and Tools
openjdk version "11.0.11" 2021-04-20 OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.10) OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.10, mixed mode, sharing)
git version 2.27.0
node: v14.0.0
npm: 7.16.0
Docker version 20.10.7, build f0df350
docker-compose version 1.29.2, build 5becea4c
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryAUTHOR ENTITY
BOOK ENTITY
Book Entity
Car ENTITY
Car Entity
Dog ENTITY
Dog Entity
ECHO ENTITY
Echo Entity
FRIEND ENTITY
Friend Entity
Browsers and Operating System
Chrome Browser Linux version 5.8.0-53-generic (buildd@lgw01-amd64-020) (gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0, GNU ld (GNU Binutils for Ubuntu) 2.35.1) #60-Ubuntu SMP Thu May 6 07:46:32 UTC 2021