-->
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.  [ 4 posts ] 
Author Message
 Post subject: Mapping problem
PostPosted: Thu Sep 16, 2010 12:58 am 
Newbie

Joined: Wed Nov 25, 2009 9:32 am
Posts: 7
Hi all!

Here is my scenario. I have a domain class Users. So far, it was mapped to a single table, which is easy. But now I have to replace the money field, with an AccountManager. An implementation of AccountManager holds Accounts in a Map. In the DB, the Accounts are stored in a table, with FK to the Users table. The Account class has an amount field, and an enum type, that is the name of the column name of the column in the DB table. So a single line of Accounts DB table with n column should create n-1 instances.

How can I map it? I've done som exesive reseach, but I found no solution so far.
Any idea?

Thanks in advance,
gmate


Top
 Profile  
 
 Post subject: Re: Mapping problem
PostPosted: Thu Sep 16, 2010 3:10 am 
Regular
Regular

Joined: Fri Aug 06, 2010 1:49 am
Posts: 102
Location: shynate26@gmail.com
Gmate,

Look for property <many-to-one

_________________

Cheers!
Shynate
mailto:shynate26@gmail.com
www.CSSCORP.com


Top
 Profile  
 
 Post subject: Re: Mapping problem
PostPosted: Thu Sep 16, 2010 5:01 am 
Newbie

Joined: Wed Nov 25, 2009 9:32 am
Posts: 7
I did check it. I couldn't find anything regarding an interface and an implemnetation of it. I can set a Map in one to hold the many, but I have to define a class. My other problem is that in mapping, you have to specify a table. In this sceario, I cannot set a table for my AccountManager.
Did I miss something in the documentation?


Top
 Profile  
 
 Post subject: Re: Mapping problem
PostPosted: Thu Oct 21, 2010 8:03 am 
Regular
Regular

Joined: Fri Aug 06, 2010 1:49 am
Posts: 102
Location: shynate26@gmail.com
How Users and Accounts related ??

_________________

Cheers!
Shynate
mailto:shynate26@gmail.com
www.CSSCORP.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.