Well, I did this:
Code:
* @hibernate.class table="oss_mas_accounts" where="ossmasacco0_.business_area.osow='X'"
and got
Code:
select
ossmasacco0_.mas_acc_code as x0_0_
from
oss_mas_accounts ossmasacco0_
where
ossmasacco0_.business_area.osow='X'
order by ossmasacco0_.acc_nbr
But then I also noticed that I was also getting
Code:
select
this.fee_rule_code as fee_rule1_1_,
this.class as class1_,
this.version as version1_,
this.rule_name as rule_name1_,
this.application_time as applicat5_1_,
this.fee_amount as fee_amount1_,
this.ledger_code as ledger_c7_1_,
this.effective_date as effectiv8_1_,
this.expiration_date as expirati9_1_,
this.refundable as refundable1_,
this.user_id as user_id1_,
ossmasacco1_.mas_acc_code as mas_acc_1_0_,
ossmasacco1_.acc_nbr as acc_nbr0_,
ossmasacco1_.acc_name as acc_name0_,
ossmasacco1_.business_area as business4_0_
from
oss_osw_fee_rule this,
oss_mas_accounts ossmasacco1_
where
this.application_time=? and
this.effective_date<? and
this.expiration_date>? and
this.ledger_code=ossmasacco1_.mas_acc_code(+)
Which appears to be selecting the fee rule and the account, missing the where clause, so it would be possible to get a result for a fee rule that referenced an account in the wrong business area.
I'm ditching the where clause for now, but I would really like to know if The second is(was? I'm using 2.1.6) a bug, or just a me missing something. I would also like to know if there is a solution to the original question.