Nemam neko iskustvo sa hibernate-om tako da je moje pitanje verovatno prilicno jednostavno (ako sam ga formulisao jasno):
Code:
q = session.createQuery("from Books where NESTO='"+nesto+"'");
List res = q.list();
q = session.createQuery("from Books where NESTO='"+nesto+"'");
List res = q.list();
e sada, recimo u klasi Books imam
Code:
private Set rentingHistories = new HashSet(0);
...
public Set getRentingHistories() {
return this.rentingHistories;
}
public void setRentingHistories(Set rentingHistories) {
this.rentingHistories = rentingHistories;
}
private Set rentingHistories = new HashSet(0);
...
public Set getRentingHistories() {
return this.rentingHistories;
}
public void setRentingHistories(Set rentingHistories) {
this.rentingHistories = rentingHistories;
}
U tom setu bi trebala da mi se nalaze stanja o knjigama tj. detalji o njihovim iznajmnjivanjima pa me zanima kako da iz tog seta izvucem objekat tipa RentingHistory i da ispitam ono sto mi je dalje potrebno!?