Remove the @EntityGraph that broke /leads on Hibernate 6.2

Fixkamo-shared-library
Ya
21 Agosti 2026, 00:07 UTC
Mwandishi
Kamo
Ahadi ya
802dea7

The grid page query failed in production with: ERROR: missing FROM-clause entry for table "a2_1" ... left join member_team_member a2_0 on **************** left join users u1_0 on u1_0.id=a2_1.user_id TeamMember is a JOINED subclass of Member, so fetching assignedTeamMember.user needs both the subclass table and the members root. Hibernate 6.2.13 emits the subclass join and then references the root's alias without ever joining it. Hibernate 6.5 renders it correctly — which is exactly why nothing caught it: this library compiles against 6.5, SecurityService runs 6.2.13, the controller tests mock the service, and LeadGridSpecificationSqlTest stops at HQL, before SQL generation. Same 6.2 joined-inheritance family as the bug JoinedInheritanceInsertSqlTest exists for. The assignee is now resolved by two queries whose shapes already run in production on 6.2.13: LeadRepository.findAssigneeRefs reads l.assignedTeamMember.id, which is the identifier and resolves to the foreign-key column with no join at all; **************** is rooted AT TeamMember and joins user explicitly, the same shape as the four JOIN tm.user queries already there. Neither asks Hibernate 6.2 to join into a JOINED hierarchy from the outside. Two cheap queries per page instead of one fetch graph, still no N+1, and LeadListDTO.fromLead now takes the resolved assignees so the row builder touches nothing lazy — which also keeps the grid independent of open-in-view. Verified by executing all three queries against production on 6.2.13, not by reasoning about them: refs OK, names OK with real values, and the grid page query itself OK. See LeadGridLiveSqlProbe in SecurityService.

Mabadiliko yote

Je, unaona nini kuhusu usafiri?

Kila moja ya hizi updates ardhi katika nafasi yako ya kazi moja kwa moja. Kuanza bure na kuangalia kukua wiki baada ya wiki.

Kuwa Huru MileleMtazamo wa bei