-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid StackoverflowError when updating entity #18866
Avoid StackoverflowError when updating entity #18866
Conversation
You should consider adding unit tests for this feature or extend existing with assertions about generated annotations |
bbd86f2
to
b03e55c
Compare
True, ideally, there would be tests that check the actual functionality and not just the presence of some annotations. I'll see, what I can do easily. |
...tors/entity-server/templates/src/main/java/package/domain/Entity.java.jhi.elastic_search.ejs
Show resolved
Hide resolved
when elasticsearch is enabled. We do add Spring Data Transient annotation on the non-owning side of relationships to break the artificial cycle introduced with the bidirectional relationship model Fixes jhipster#18729
b03e55c
to
f697f33
Compare
Meh, due to the changes of #17488 entities with custom id names will fail compilation 👎 Will fix this at well. |
Ok, so whenever I put a required validation attribute to an entity's relationship, tests do get generated that perform also the previously failing things (I tested manually for now with my jdl that produced failing PUT methods). |
let's see the result
f9b6a78
to
b0a4536
Compare
I mean unit tests for generator itself. And maybe also for CI |
Well, during the CI here, plenty of applications are produced and their automated tests are being run, so adding this case into the sample applications' datamodel to reproduce the case should be sufficient. |
Thanks. :) |
@OmarHawk approved |
Are you guys certain, that @transient is the solution? |
Well, at least it avoids that the functionality is not available at all. And what we currently do is generating the transient annotation only in one direction of the relationship if I remember my thoughts about that again, so that the index is not really empty. What this Pull Request also does not do is checking whether someone actually created a cycle in it's data model... this would also requiring to break the cycle somehow... |
Yes, and in most cases this solves the case, because you don't need both directions. |
when elasticsearch is enabled. We do add Spring Data
Transient annotation on the non-owning side
of relationships to break the artificial cycle introduced with the
bidirectional relationship model
Fix #18729
Fix #14840
Fix #16136
Please make sure the below checklist is followed for Pull Requests.
When you are still working on the PR, consider converting it to Draft (below reviewers) and adding
skip-ci
label, you can still see CI build result at your branch.