dpmihai wrote:
I have the following code :
.....
String sql = "from TABLE1 a where a.ban in " +
"( select c.ban from TABLE2 c where c.id = :id )";
sess.createQuery(sql).setLong("id", subsId.longValue()).list();
........
But when I run I get an error in parsing the sql saying an "in" is required.
Can you tell me what is wrong with this hibernate query?
Mike
Hi,
Change your hiberante config file, so that you can see the SQL statements. and you can find if there is problem in sql statement.
change the above one and try this one
List results = session.createQuery("from Category c " +
"where :item in (from c.items)").setEntity("item", item).list();
Let us know if it works and also send the SQL statement generated in the log/console.