-->
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: collection mapping of legacy database
PostPosted: Fri Jun 06, 2008 10:03 am 
Newbie

Joined: Tue Jan 09, 2007 9:53 am
Posts: 2
Hi,

Here is my question. I have two tables : Product and Translation. Translation contains both name and description of each product in several languages. The DDL looks like :

Code:
Product (
    prod_id NUMBER(10) PRIMARY KEY,
    name NUMBER(8),
    description NUMBER(8)
);

Translation (
    trans_id NUMBER(10) PRIMARY KEY,
    code NUMBER(8) NOT NULL,
    type NUMBER(3) NOT NULL,
    value VARCHAR(200)
);


These are legacy tables. 'name' and 'description' in Product are related to 'code' in Translation, and not to the obvious 'trans_id'. The 'type' field indicates whether the translation is for a name, a description or something else.

What I would like to do is map a collection (set, map, whatever) of translations for the name and another for the description in the Product mapping, but I can't find a way. The <key /> element is mandatory and since 'trans_id' is not the foreign key, I don't know how to do it.

Any hint?


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.