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: Collections of components
PostPosted: Mon Mar 10, 2008 8:29 am 
Newbie

Joined: Wed Feb 23, 2005 9:01 am
Posts: 9
Location: London
Hello

Newbie.

Suppose I have a PhotoAlbum class that contains a Set of Photos.

The Photos collection is mapped as a component.

Ultimately this is backed by a "Photos" table containing Id, Photoname and Location fields.

Suppose there is an Order class that also comprises a Set of Photos. Note that the Order and PhotoAlbum classes are unrelated for this exercise.

My question is, can the Order and PhotoAlbum classes use the same "Photos" table? I thought not because the primary key of the Photos table is associated with PhotoAlbum class only. Basically, although I have one Photos class, if I use it as a value type then do I have to define two Photos SQL tables (one for the PhotoAlbum and one for the Order)? One class, two tables.

Thanks

Mark


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.