Hi guys,
I have an SQL query which I need to translate to Hibernate:
SELECT * FROM LeaseCars JOIN Contract ON Contract.LeaseCarID = LeaseCars.LeaseCarID WHERE Contract.ContractStatus = HISTORY;
Already got this piece of Hibernate code to work:
public List<Car> getUnusedCars() { return baseDAO.getCarsByCriteria(Restrictions.eq("carStatus", "0"), Restrictions.eq("brand", "Subaru")); }
This uses one table, so I'm stuck on joining multiple tables in one query. Anyone knows how to do this? I am completely new to Hibernate so please go easy on me :)
|