I have a big table "account" that several other tables also link to, so I want to split the mapping into 2 objects, one for the fields in the table (AccountDetail), and another one (Account) for managing the relationships with other objects/tables. I want to implement this as one-to-one, but had problems with the following approaches:
1. use Mapping, account.getAccountDetail(): got class cast error.
2. use session.load(AccountDetail.class, accountId) directly: gives me class cast error, because even though AccountDetail.class is supplied, Account is returned.
3. use session.load(accountDetail, accountId): gives me object already loaded error.
How should I solve this problem?
Thanks,
Kaiwen
|