Skip to content

fix: Remove sorting from pageable in favorite applications list - MEED-10293 - Meeds-io/meeds#4112#580

Merged
Jihed525 merged 1 commit intostable/7.1.x-exofrom
backportstable-10293
Apr 1, 2026
Merged

fix: Remove sorting from pageable in favorite applications list - MEED-10293 - Meeds-io/meeds#4112#580
Jihed525 merged 1 commit intostable/7.1.x-exofrom
backportstable-10293

Conversation

@Jihed525
Copy link
Copy Markdown
Contributor

@Jihed525 Jihed525 commented Apr 1, 2026

Prior to this change, when the page size is not = 0 then an error is raised in logs:

java.lang.IllegalArgumentException: org.hibernate.query.sqm.UnknownPathException: Could not resolve attribute 'createdAt' of 'io.meeds.appcenter.entity.ApplicationEntity' [SELECT new FavoriteApplicationEntity(favoriteApp.id, app, favoriteApp.userName, favoriteApp.order, favoriteApp.favorite) FROM ApplicationEntity app LEFT JOIN FavoriteApplicationEntity favoriteApp ON app.id = favoriteApp.application.id AND favoriteApp.userName = :userName WHERE app.active = TRUE AND (app.isMandatory = TRUE OR (favoriteApp.id IS NOT NULL AND favoriteApp.favorite = TRUE) OR (favoriteApp.id IS NULL AND app.isDefault = TRUE)) ORDER BY favoriteApp.order NULLS LAST, app.order NULLS LAST, app.isMandatory DESC, app.createdAt desc]

The field createdAt doesn' t exist in JPA Entity ApplicationEntity which causes this error. This change will remove the default pageable sort default options to avoid fetching non existant field.

(cherry picked from commit 68a2a1b)

…D-10293 - Meeds-io/meeds#4112 (#576)

Prior to this change, when the page size is not = 0 then an error is
raised in logs:

```
java.lang.IllegalArgumentException: org.hibernate.query.sqm.UnknownPathException: Could not resolve attribute 'createdAt' of 'io.meeds.appcenter.entity.ApplicationEntity' [SELECT new FavoriteApplicationEntity(favoriteApp.id, app, favoriteApp.userName, favoriteApp.order, favoriteApp.favorite) FROM ApplicationEntity app LEFT JOIN FavoriteApplicationEntity favoriteApp ON app.id = favoriteApp.application.id AND favoriteApp.userName = :userName WHERE app.active = TRUE AND (app.isMandatory = TRUE OR (favoriteApp.id IS NOT NULL AND favoriteApp.favorite = TRUE) OR (favoriteApp.id IS NULL AND app.isDefault = TRUE)) ORDER BY favoriteApp.order NULLS LAST, app.order NULLS LAST, app.isMandatory DESC, app.createdAt desc]
```

The field `createdAt` doesn' t exist in JPA Entity `ApplicationEntity`
which causes this error. This change will remove the default pageable
sort default options to avoid fetching non existant field.

(cherry picked from commit 68a2a1b)
@Jihed525 Jihed525 self-assigned this Apr 1, 2026
@Jihed525 Jihed525 enabled auto-merge (rebase) April 1, 2026 09:31
@Jihed525 Jihed525 merged commit 23a5f81 into stable/7.1.x-exo Apr 1, 2026
13 checks passed
@Jihed525 Jihed525 deleted the backportstable-10293 branch April 1, 2026 09:35
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 1, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants