SELECT * FROM test.pchi new INNER JOIN rlhi old ON new_id = old.menu_id where new.name='?'
Similar to:
Select * from db.employee emp INNER JOIN db.table on emp_tableID = table.id where emp.name = '?'
If you could tell me how to do a projection, that would be awesome... as in:
Select emp.name, emp.sex, table.brand from ....
I tried using fetch, but I'm very new to this and keep getting some weird errors. Could someone please demonstrate how to do this?
How about this?
sess.createCriteria(pchi.class)/**/
.setFetchMode("rlhi", FetchMode.JOIN)
.add(Restrictions.eq("new_id", "rlhi.menu_id"))
.add(Restrictions.eq("name", "SOME INPUT"))