You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to be able to return a collection of projections while using specifications to filter them. I found the newly introduced findBy convenience in the JpaSpecificationExecutor interface but when I try to return a page of projections, it simply ends up retrieving all the columns from the database.
// MyProjection is an interface with nothing special about it// Here specification is dynamically constructedreturnmyRepository.findBy(specification, q -> q
.as(MyProjection.class)
.page(pageable));
This problem is very similar to the closed #2632. However, I cannot resort to using JPQL or native queries because I have a need to use complex and dynamically constructed specifications to filter out the results.
The table I am querying contains a few JSONB (Postgres) columns that can contain huge JSON documents. So, even though I'm declaring projection interfaces without the JSONB columns, the actual query being made to the database ends up still retrieving the unwanted columns. This causes a massive performance degradation and the approach doesn't scale well.
I'm really out of my depth here and would appreciate any insights or tips.
The text was updated successfully, but these errors were encountered:
I would like to be able to return a collection of projections while using specifications to filter them. I found the newly introduced
findBy
convenience in theJpaSpecificationExecutor
interface but when I try to return a page of projections, it simply ends up retrieving all the columns from the database.This problem is very similar to the closed #2632. However, I cannot resort to using JPQL or native queries because I have a need to use complex and dynamically constructed specifications to filter out the results.
The table I am querying contains a few JSONB (Postgres) columns that can contain huge JSON documents. So, even though I'm declaring projection interfaces without the JSONB columns, the actual query being made to the database ends up still retrieving the unwanted columns. This causes a massive performance degradation and the approach doesn't scale well.
I'm really out of my depth here and would appreciate any insights or tips.
The text was updated successfully, but these errors were encountered: