sample hql: SELECT ig FROM InfoGoods AS ig, InfoPublish AS ip, PublishGoods AS pg WHERE ig.gId=pg.id.gId AND ip.pId=pg.id.pId AND ip.pName LIKE '%出版商的名字(或名字的一部分)%'
List cats = session.createQuery( "from InfoGoods as goods where goods.birthdate < ?") .setDate(0, date) .list();
sorry, 刚才那贴发错了List goods = session.createQuery( "from InfoGoods as goods where goods.gId in " + "(select pg.gId from PublishGoods as pg where pg.pId in " + "(select publish.pId from InfoPublish as publish where publish.pName like ?))") .setString(0, "%" + input_string + "%") .list();
SELECT ig FROM InfoGoods AS ig, InfoPublish AS ip, PublishGoods AS pg
WHERE ig.gId=pg.id.gId AND ip.pId=pg.id.pId
AND ip.pName LIKE '%出版商的名字(或名字的一部分)%'
"from InfoGoods as goods
where goods.birthdate < ?")
.setDate(0, date)
.list();
"from InfoGoods as goods where goods.gId in " +
"(select pg.gId from PublishGoods as pg where pg.pId in " +
"(select publish.pId from InfoPublish as publish where publish.pName like ?))")
.setString(0, "%" + input_string + "%")
.list();
"WHERE ig.gId = pg.id.infoGoods.gId AND ip.pId = pg.id.infoPublish.pId " +
"AND ip.pName LIKE '" + searchkey + "'";