Say, I have the following entity class:
Person.java
@Entity
public class Person {
@Id
private String name;
private String[] c
Ideally, You should declare cars as a separate Entity like this
@Entity
public class Person {
@Id
private String name;
private List cars;
// Constructor, getters and setters
}
If not you should change Array to List at the least. change
private String[] cars;
to
@ElementCollection
private List cars;
Then You have to write a Query like this
@Query("select p from Person p WHERE :car in elements(p.cars)")
List getAllByCars...(@Param("car") String car)