考虑以下:
@Entity
public class Book
{
private List<String> authors;
@ElementCollection
public List<String> getAuthors() {
return authors;
}
public void setAuthors(List<String> authors) {
this.authors = authors;
}
}
Run Code Online (Sandbox Code Playgroud)
如何输入JPA2 CriteriaQuery表达式,比方说,让我找到所有超过2位作者的书籍?