-->
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: composed primary key using foreign keys AND native ones
PostPosted: Thu Jun 01, 2006 8:28 am 
Newbie

Joined: Thu Jun 01, 2006 8:17 am
Posts: 10
Location: mostly lake of constance
hello together,
i have to map a very tricky database schema. i have a table, with a composed primary key of two foreign keys and one native generated key.

my first aproach for the primary key looked like this:


Code:

<composite-id>
          <key-many-to-one name="ObjectItem" column="OBJ_ITEM_ID" class="ObjectItem"/>
          <key-many-to-one name="Capability" column="capap_id" class="Capability"/>
          <key-property name="id" column="obj_item_capab_index" type="java.lang.Long"/>
      </composite-id>


but how can i say that the obj_item_capab_index should be generated automatically analog to:
Code:
<id name="id" column="obj_item_capab_ix" type="java.lang.Long" unsaved-value="null">
         <generator class="native"/>      
      </id>

anybody an idea?


Top
 Profile  
 
 Post subject: thank you all!
PostPosted: Mon Jun 12, 2006 5:55 am 
Newbie

Joined: Thu Jun 01, 2006 8:17 am
Posts: 10
Location: mostly lake of constance
the masses of replies helped me a lot...


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.