Skip to content

Commit 99ff6a0

Browse files
committed
Fix relationships
1 parent f1ada2f commit 99ff6a0

File tree

1 file changed

+4
-0
lines changed
  • generators/spring-boot/templates/src/main/java/_package_/_entityPackage_/_partials_entity_

1 file changed

+4
-0
lines changed

generators/spring-boot/templates/src/main/java/_package_/_entityPackage_/_partials_entity_/get_all_template.ejs

+4
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ _%>
7878
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}); -%>
7979
log.debug("REST request to get all <%= entityClassPlural %>");
8080
<%_ if (viaService) { _%>
81+
<% if (implementsEagerLoadApis) { %>
82+
return <%= entityInstance %>Repository.findAllWithEagerRelationships()<% if (reactive) { %>.collectList()<% } %>;
83+
<%_ } else { _%>
8184
return <%= entityInstance %>Service.findAll()<% if (reactive) { %>.collectList()<% } %>;
85+
<%_ } _%>
8286
<%_ } else if (dtoMapstruct) { _%>
8387
<%= reactive ? 'Flux' : 'List' %><<%= persistClass %>> <%= entityInstancePlural %> = <%= entityInstance %>Repository.findAll();
8488
<%_ if (reactive) { _%>

0 commit comments

Comments
 (0)