-->
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.  [ 1 post ] 
Author Message
 Post subject: Doubt about mapping
PostPosted: Mon Jan 22, 2007 12:57 pm 
Beginner
Beginner

Joined: Tue Sep 05, 2006 2:36 pm
Posts: 24
I have the following table structure:

Code:

bots
****
botid (long)
name (varchar)


subs
****
subid (long)
botid (long)



And the classes are:

Code:

public class Bot{
  Long id;
  Sub sub;
// setters and getters
}

public class Sub{
  Long id;
// setters and getters
}



Looking at the table structure is reasonable to think that the Bot class should hold a "list" of instances of Sub.
But the actual administration interface is thought to assign only one Sub to each Bot.

Is there any one to map this?

The idea is to save a Bot and automatically save its Sub.

PS: I have not designed the class diagram neither the database structure, and I can't change it.

Thanks.


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

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.