-->
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: Which mapping to use?
PostPosted: Tue Apr 05, 2005 12:35 pm 
Beginner
Beginner

Joined: Tue Apr 05, 2005 12:09 pm
Posts: 48
Location: Slovakia (SK), Košice (KE)
Hibernate version: 3.0
Name and version of the database you are using: Oracle 9

Hello

I am new to Hibernate. Suppose three tables: business_case, message and language. Each business case has title and description. Both title and description are translated to all supported languages listed in table language. Theese translations are stored in message table.

Code:
TABLE: language
COLUMNS: language_id, name
PRIMARY KEY: language_id

TABLE: message
COLUMNS: language_id, key, value
PRIMARY KEY: language_id, key
FOREIGN KEY: language_id

TABLE: business_case
COLUMNS: business_case_id, title_key_id, description_key_id, ...
PRIMARY KEY: business_case_id


I've already mapped table language to message:
Code:
<class name="Message" table="MESSAGE">
   <composite-id>
      <key-many-to-one name="language" column="LANGUAGE_ID" class="Language" />
      <key-property name="key" column="KEY" />
   </composite-id>
   <property name="value" column="VALUE" length="255" not-null="true" />
</class>


Please help me how to map business_case to message. title_key_id and description_key_id in business_case should refer to message. Link to correct documentation anchor is sufficient.

Thanks in advance
Martin


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.