'JPQ query Join on a LIst?

I'm in Spring Boot and I'm having a problem finding out how to write a query. Basically i have those class

public Class Book{
  private long id
  private String title
  private List<Author> authors
...
}
public Class Author{
  private long id
  private String authorName
 
}

where authors can be a variable number of Author. I have a @ManyToMany and a @JoinTable between the 2 ids. Problems is: How can i write a method which takes one author's id and gives me all the books where he's present in the list? Do i need a query for it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source