-
-
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
Fix relationships #25876
base: main
Are you sure you want to change the base?
Fix relationships #25876
Conversation
@@ -78,7 +78,11 @@ _%> | |||
public <% if (reactive) { %>Mono<<% } %>List<<%= instanceType %>><% if (reactive) { %>><% } %> getAll<%= entityClassPlural %>(<% if (fieldsContainNoOwnerOneToOne) { %>@RequestParam(name = "filter", required = false) String filter<% } %><% if (implementsEagerLoadApis && fieldsContainNoOwnerOneToOne) { %>,<% } %><% if (implementsEagerLoadApis) { %>@RequestParam(name = "eagerload", required = false, defaultValue = "true") boolean eagerload<% } %>) {<%- include('get_all_stream_template', {viaService: viaService}); -%> | |||
log.debug("REST request to get all <%= entityClassPlural %>"); | |||
<%_ if (viaService) { _%> | |||
<% if (implementsEagerLoadApis && !dtoMapstruct) { %> | |||
return <%= entityInstance %>Repository.findAllWithEagerRelationships()<% if (reactive) { %>.collectList()<% } %>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
findAllWithEagerRelationships
should be used for collections where we should avoid multiple bags.
This error looks related to the repository since the relationships are not collections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the best way to proceed with getting this merged? Is it good enough for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like findAllWithEagerRelationships
is used bellow, but this is ignoring the service layer and executing the repository.
It's probably required to add a parameter at service layer to make it optional like it's in the rest layer.
...oot/templates/src/main/java/_package_/_entityPackage_/_partials_entity_/get_all_template.ejs
Outdated
Show resolved
Hide resolved
@qmonmert Do you want to try to get this into the next release? |
…tyPackage_/_partials_entity_/get_all_template.ejs Co-authored-by: Marcelo Shima <[email protected]>
Fix #25846
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.