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

    status: feedback-reminderWe've sent a reminder that we need additional information before we can continuestatus: waiting-for-feedbackWe need additional information before we can continuestatus: waiting-for-triageAn issue we've not yet triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions