Reputation: 1459
Let's say I have class A and B
public class A{
@Id
String id;
private B b;
}
public class B{
@Id
String id;
private List<A> a;
}
I'm using @Query
for my query since my query is too long for Query creation .
@Query("select a from A a where b = :b")
public List<A> findSomething(@Param("b") String bId);
However, when I use that query it shows
Parameter value did not match expected type [B (n/a)]
Upvotes: 2
Views: 3350
Reputation: 474
Please change query to "select a from A a where a.b.id = :b". It will work
Upvotes: 4