Hi,
I have this class
Code:
<class name="OrderHeader" table="REORDH">
...
<property name="statusDescription" formula="(select CLTEXT from RESCOL where CLLIST = 1005 AND CLVALN = 10)" />
</class>
i want to get the value of statusDescription from different table.
This is the sql hibernate is generating:
Code:
select
orderheade0_.RHCUST= as RHCUST,
orderheade0_.RHORNO as RHORNO,
orderheade0_.RHCNSL as RHCNSL,
orderheade0_.RHOSTS as RHOSTS,
(select orderheade0_.CLTEXT from RESCOL where orderheade0_.CLLIST = 1005 AND orderheade0_.CLVALN = 10) as f0_
from REORDH orderheade0_
where (orderheade0_.RHCUST=? )
As you can see, the inner select is not what i expected.
I tried puuting alias but no change.
I tried to use other maped objects in the inner select but it didn't help as well.
what am i doing wrong?