hibernate配置文件中

来源:百度知道 编辑:UC知道 时间:2024/05/15 23:48:38
我要查询from Outbox outb where outb.id in(select mailId from Recyclebin)但是问题提示说Recyclebin is not mapped,这个hql语句是在Outbox中写的,请问该怎么解决
他门之间没有设置关联关系,只是逻辑上的关联

如果你的关联没问题且标准!
from Outbox outb where outb.id in(select mailId from Recyclebin)改成
from Outbox outb where outb.id in(select mailId from outb.recyclebins)
用Outbox对象去取关联的Recyclebin对象!
--------------------------------------------------------------
不关联不能用HQL查询,
那你该成SQL查询吧!就是写SQL语句的那种!

Recyclebin
你这个表反转没?