-->
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: Stuck with propper inheritance strategy choice
PostPosted: Wed Sep 17, 2008 11:09 am 
Newbie

Joined: Wed Sep 17, 2008 10:51 am
Posts: 7
Hi.

I'd like to ask the experienced hibernate users for advice to choose a correct inheritance subclassing strategy.

I've read the online documentation as well as (very useful, btw) java persistence with hibernate book, and still stuck...

Here is the deal: I have a table hierarchy for multilingual support, that consists of one main table and multipple language tables for each logical type, i.e. cities is the main one and holds things like code, iscapital, etc. while cities_en, cities_ru and cities_fr are corresponding tables with localized information like city name. The same going for states, countries, etc...

From java point of view I'd like that each city will be a subclass of some AbstractCity class, according to locale (i.e. I'll have CityEn, CityFr and CityRu, all 3 are subclasses of AbstractCity). This is a requirement and has to be done this way, other kind of mapping is not an option.

Now, the most logical choice is to map cities table to some AbstractCity class and then each of CityFr, CityEn, etc. as a joined subclasses, with mapping to corresponded localized table. The problem is that it seems I can only do one-to-one relations this way, while I need that each row from cities general table will be part of each localized city, joined with corresponding localized information (the key is same, of course).

Please help me with this, I fill that I'm missing something simple that prevents me from getting it to work.

Thanks a lot,
Alex.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 18, 2008 1:23 pm 
Newbie

Joined: Wed Sep 17, 2008 10:51 am
Posts: 7
Anyone? Is this really unresolvable problem?


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.