-->
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.  [ 3 posts ] 
Author Message
 Post subject: How can i map a joined-subclass using a composite key ?
PostPosted: Mon Nov 17, 2003 6:30 pm 
Newbie

Joined: Mon Sep 08, 2003 12:32 pm
Posts: 10
Hi,

Class Bar subclass Foo, using the composite key formed with idPart1 & idPart2:

create table Foo (
idPart1 INT,
idPart2 INT,
desc VARCHAR);

create table Bar (
idPart1 INT,
idPart2 INT,
someValue VARCHAR);

How can I map this ? The does not mention the use of composite keys
for joined subclasses

thx
tom nguyen

_________________
thanh nguyen/


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 17, 2003 6:52 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Something like that I guess
Code:
<joined-subclass ...>
   <key>   <!-- a collection inherits the composite key type -->
      <column name="idPart1"/>
      <column name="idPart2"/>
    </key>

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 18, 2003 1:24 pm 
Newbie

Joined: Mon Sep 08, 2003 12:32 pm
Posts: 10
That worked.
I should have looked in the dtd.
thx.

_________________
thanh nguyen/


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