-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: one-to-one on one big table
PostPosted: Mon Nov 24, 2003 8:33 pm 
Newbie

Joined: Mon Nov 24, 2003 8:21 pm
Posts: 2
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


Top
 Profile  
 
 Post subject: use component
PostPosted: Mon Nov 24, 2003 9:35 pm 
Senior
Senior

Joined: Sun Aug 31, 2003 3:14 pm
Posts: 151
Location: Earth (at the moment)
Use the <component...> mapping.
Map your AccountDetail class as a component of your Account class.


Top
 Profile  
 
 Post subject: thanks a lot
PostPosted: Tue Nov 25, 2003 10:16 am 
Newbie

Joined: Mon Nov 24, 2003 8:21 pm
Posts: 2
i'll try <component


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.