-->
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.  [ 2 posts ] 
Author Message
 Post subject: Multiple tables for the same class used in diff. containers?
PostPosted: Sat Aug 06, 2005 10:48 pm 
Newbie

Joined: Sat Aug 06, 2005 10:26 pm
Posts: 1
Hello, all.

I am trying to model a series of documents (magazines, books, pamphlets) all of which have pages.

The classes Book, Magazine and Pamphlet are defined as children of PageCollection, an abstract class with a one-to-many relationship to a Page class.

I would like each PageCollection subclass to get its Page objects from a different table (Book gets its Pages from the table BOOK_PAGES, Magazine from MAGAZINE_PAGES and so on), to help reduce the size of each table.

I could do this by defining three classes (BookPage, MagazinePage, PamphletPage), each using a different table, but as long as all three PageCollections use identical Pages, I would rather have the annotations or mapping file tell each PageCollection class to use a different table for its Page objects.

Is there a simple way to do this, or am I better off using a different class for each item's Pages?

Thanks for any help,
Ed


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 07, 2005 12:09 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Have a look at the "entity-name" mapping attribute (hint : match up its usage between <class/> and various association mappings).


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