Skip to content

Joins with identical property names are not rendered by JpqlQueryBuilder #3989

@xanscale

Description

@xanscale

this query method works well on spring data 3.5.3 but fails on 4.0.0-M5:

List<TeamKnowledge> findAllByIdTeamUserTeamsIdUserIdAndIdTeamSpaceId (@NotNull String userId, @NotNull Long spaceId, Pageable pageable);

on spring data rest 4 i receive this error

{
  "cause": {
    "cause": {
      "cause": null,
      "message": "Could not interpret path expression 'i.user.id'"
    },
    "message": "org.hibernate.query.SemanticException: Could not interpret path expression 'i.user.id'"
  },
  "message": "org.hibernate.query.SemanticException: Could not interpret path expression 'i.user.id'; Bad SELECT t FROM ....TeamKnowledge t INNER JOIN t.id join_0 LEFT JOIN join_0.team join_1 LEFT JOIN join_1.userTeams u LEFT JOIN join_1.space s WHERE i.user.id = :userId AND s.id = :spaceId grammar [JPQL]"
}

TeamKnowledge uses EmbeddedId

if i use Query annotation replacing i.user.id with u.id.user.id all works.

i think there is some bug in JQPL generation

full example here : https://github.com/xanscale/springDataError

Metadata

Metadata

Assignees

Labels

type: regressionA regression from a previous release

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions