My Application's mapping:
Code:
<subclass name="Application">
<one-to-one name="communityAccount" class="CommunityAccount" constrained="true"/>
<one-to-one name="bankAccount" class="BankAccount" constrained="true"/>
</subclass>
The relationship in Account's mapping
Code:
<many-to-one name="owner" column="owner_id" class="Application"/>
My Table Accounts in DataBase
Code:
+------------+---------------------+----------+----------+
| account_id | creationDate | owner_id | amount |
+------------+---------------------+----------+----------+
| 1 | 2003-12-11 14:11:51 | 1 | 52.7 |
| 2 | 2003-12-11 14:11:51 | 1 | 41.8 |
The application is a singleton stored in my DataBase in the first row(id 1) has two accounts,
when I load this row Hibernate throw an exception: More than one row to unique association!