-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
status: waiting-for-triageAn issue we've not yet triagedAn issue we've not yet triaged
Description
@Entity
public class MyEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToMany
@JoinTable(name = "entity_stuff_join_table", joinColumns = {@JoinColumn(name = "fk_stuff")}, inverseJoinColumns = @JoinColumn(name = "fk_my_entity"))
private List<Stuff> stuffList;@Repository
public interface MyEntityRepository extends JpaRepository<MyEntity, Long> {
void existsByStuffList(List<Stuff> stuffList);
void existsByStuffList(Stuff stuff);
}When calling either method this exception is thrown:
Multivalued paths are only allowed for the 'member of' operator; Bad SELECT m.id id FROM MyEntity m WHERE m.stuffList = :stuff grammar [JPQL]
The second method worked with Spring 6. I didn't test the first one but would assume that it worked too.
Edit: I just confirmed that both methods worked in Spring Data JPA 3.5.8. Make sure to call the first method with an immutable list of size one.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
status: waiting-for-triageAn issue we've not yet triagedAn issue we've not yet triaged