Skip to content

JPA Query Methods bug in Spring Data JPA 4.0.0-M5 #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 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 com.localhostSoftware.notYet.persistence.relation.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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions