-->
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: Mapping Joined-Subclass with Discriminator
PostPosted: Wed Jun 22, 2005 6:57 pm 
Newbie

Joined: Wed Jun 22, 2005 6:38 pm
Posts: 7
Hibernate version: 2.1.8

I have a Parent table that I would like to subclass using joined-subclasses, however, the ID on this table is not unique (it's a view combining disparate tables). I would like to preserve uniquity by using an OBJECT_TYPE indicator (maybe a composite-id?). Is there a way to do this such that I can make the OBJECT_TYPE a discriminator?

I know that discriminators aren't typically used for joined-subclasses but I was hoping there might be a way to do this for my situation.

Thanks,
Jon


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 19, 2005 4:57 pm 
Regular
Regular

Joined: Sat Nov 19, 2005 2:46 pm
Posts: 69
a <joined-subclass> needs a <key>, which according to the DTD can take many <column> tags, so you would do this:
Code:
<joined-subclass name="abc" table="abc">
  <key>
    <column name="pk1"/>
    <column name="pk2"/>
  </key>
</joined-subclass>

_________________
Stewart
London, UK


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.