I have an object Worker with a collection of objects Job :
public class Worker {
private int id;
private String mail;
private Set<Job> job;
}
public class Job {
private int id;
private String name;
}
I would like to make a request to get the Worker a certain mail and contains in his collection certain jobs (by their id). How could I do that ?
public List<Worker> getListWorker (String mail, List<Integer> listJobId){
//Some hibernate magic here
}
I have tried a lot a things but none actually worked (add multiple restrictions on jobs, with alias, with detachedCriteria...). Can someone help me on this ?