Hello. I have the following mapping but I'm getting an error possibly due to the fact that "amountAllocated" is null as a result of no rows.
Code:
<class name="AccountAllocation" table="ACCOUNT_ALLOCATION">>
<id name="accountAllocationId" column="ACCT_ALCN_ID">
<generator class="assigned"/>
</id>
<property name="accountId" column="ACCT_ID" />
<property name="amountAllocated"
formula="(SELECT SUM(a.ALCN_AMT) FROM ALLOCATION a WHERE a.ACCT_ALCN_ID = ACCT_ALCN_ID)"/>
How do I get around this? There is a possibility that there might not be any "amountAllocated" (rows) in which case I'd like this set to 0 (zero). Also, is it possible that my database (Oracle 9i) might not support this?