-->
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: joined-subclass with composite keys
PostPosted: Thu Jul 07, 2005 4:07 pm 
Newbie

Joined: Fri Apr 22, 2005 3:21 pm
Posts: 12
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:2.1.7


Mapping documents:
<hibernate-mapping>
<class
name="package.OyQuestionAnswer"
table="O_QUESTION"
dynamic-update="false"
dynamic-insert="false"
>

...............

<joined-subclass name="package.DWireAnswer"
table="D_WIRES"
dynamic-update="false"
dynamic-insert="false"
>
<key column="O_ID" />

......................
</joined-subclass>





I need to have the column id for joined subclass to be a composite id composed of two columns. I have tried some of the know syntaxes for hibernate to know success. Any suggestions would be very helpful.


Top
 Profile  
 
 Post subject: Found the answer but xdoclet problem
PostPosted: Fri Jul 08, 2005 11:06 am 
Newbie

Joined: Fri Apr 22, 2005 3:21 pm
Posts: 12
Okay I found the answer to my question which is the following but has anyone successfully generated this using xdoclet ( the latest version ).
It seems to me using xdoclet you can do

/ * @hibernate.joined-subclass table="T_D_W"
* dynamic-update="true"
* dynamic-insert="true"
* lazy="true"
* @hibernate.joined-subclass-key
* column="O_ID"
*/

But you cannot define the multiple column names. I had to manually update the following segment of the hbm file. Any experiences in this regard ?


-----------------------------------------------------------
<joined-subclass name="package.DWireAnswer"
table="D_WIRES"
dynamic-update="false"
dynamic-insert="false"
>
<key>
<column name="O_ID"/>
<column name="Q_ID"/>
</key>

......................
</joined-subclass>


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.