-->
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: Mapping confusion
PostPosted: Tue Sep 14, 2004 11:21 am 
Newbie

Joined: Tue Sep 14, 2004 8:59 am
Posts: 5
Im having a bit of problems figuring out how to do the best mapping for my domain.

I have a:

User object that have a Bookshelf

The bookshelf have Booklines that contains a reference to a Book and some other atributes

I have the bookshelf because i thought it would be best to have methods there and not on the user for get/add book and so on.

The bookline contains information about if the book is avalible and so on.

Even if more users have the same book the book is only 1 time in the database.

With my current mapping i get a bookshelf table only containing the id of itself and that id is a foreign key in the bookline.
Does that even make sense?
I would think it would be better to have the userid in the userline
but i still would like to have the booklines added to the bookshelf set when its retrived from the database.

Can someone please point me in the right direction and suggest the mappings used?


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.