我正在运行一个具有正确连接的 hql:
select sum(banks.money) from banks right join banks.account where banks.account = :account and (banks.date < :date or banks.date is null) group by banks.account, banks.date
hibernate 把它翻译成这样的:
select sum(banks.money) from banks right join accounts on banks.account_id = accounts.account_id where banks.account_id = someId and (banks.date < someDate or banks.date is null) ....
我希望休眠从 accounts 表中获取 account_id 字段(我可以有一个不在银行表中的帐户)而不是从银行表中获取。
有没有办法明确告诉休眠在连接表的哪一列上执行?