мой запрос:
@Query("select a from Advertisements a where a.name = ?1 and ((?2>=0 and a.price<=?2) or (?3>=0 and a.price>=?3)) and a.tag in %3 order by a.Numberviews DESC")
List findByFilterByNumberviews( String name, int topprice, int lowprice, Set tags);
Таблица Advertisements:
@Entity
@Table(name = "Advertisements")
public class Advertisement {
@Id
@GeneratedValue(strategy= GenerationType.AUTO)
// @Column(name="id")
private UUID idAdvertisement;//номер в общем риестре записей
private int price;
private String name;
private String description;
//количество просмотров
private int numberviews;
//много объявлений принадлежат одному тэгу
@OneToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "idAdvertisement")
//здесь хрениться один тэг - самый дочерний
private Tag tag= new Tag();
...
ошибка:
Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List com.example.NedoAvito.repository.AdvertisementRepository.findByFilterByNumberviews(java.lang.String,int,int,java.util.Set)!