Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1742 from benetech/1740
Browse files Browse the repository at this point in the history
#1740: Fix ProviderRecordDTO constructor for public view
  • Loading branch information
kdondziak authored Feb 17, 2021
2 parents 71e8db1 + cfd9210 commit 871629e
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,18 @@ public Page<ProviderRecordDTO> findAllWithFiltersPublic(ProviderFilterDTO provid
Root<Organization> selectRoot = queryCriteria.from(Organization.class);
Join<Organization, SystemAccount> systemAccountJoin = selectRoot.join(Organization_.ACCOUNT, JoinType.LEFT);
Join<Organization, UserProfile> userProfileJoin = selectRoot.join(Organization_.USER_PROFILES, JoinType.LEFT);
Join<Organization, UserProfile> updatedByJoin = selectRoot.join(Organization_.UPDATED_BY, JoinType.LEFT);

queryCriteria.select(cb.construct(ProviderRecordDTO.class, selectRoot.get(Organization_.ID), selectRoot.get(Organization_.NAME),
systemAccountJoin.get(SystemAccount_.ID), systemAccountJoin.get(SystemAccount_.NAME),
userProfileJoin.get(UserProfile_.LOGIN), selectRoot.get(Organization_.UPDATED_AT), selectRoot.get(Organization_.ONLY_REMOTE),
selectRoot.get(Organization_.FACEBOOK_URL), selectRoot.get(Organization_.TWITTER_URL), selectRoot.get(Organization_.INSTAGRAM_URL)));
selectRoot.get(Organization_.FACEBOOK_URL), selectRoot.get(Organization_.TWITTER_URL), selectRoot.get(Organization_.INSTAGRAM_URL),
updatedByJoin.get(UserProfile_.LOGIN)));

addFilters(queryCriteria, selectRoot, systemAccountJoin, userProfileJoin, silo, providerFilterDTO, search);
queryCriteria.groupBy(selectRoot.get(Organization_.ID), selectRoot.get(Organization_.NAME),
systemAccountJoin.get(SystemAccount_.ID), userProfileJoin.get(UserProfile_.LOGIN), selectRoot.get(Organization_.UPDATED_AT));
systemAccountJoin.get(SystemAccount_.ID), userProfileJoin.get(UserProfile_.LOGIN), selectRoot.get(Organization_.UPDATED_AT),
updatedByJoin.get(UserProfile_.LOGIN));
addSorting(queryCriteria, pageable.getSort(), selectRoot);

Query query = createQueryWithPageable(queryCriteria, pageable);
Expand Down

0 comments on commit 871629e

Please sign in to comment.