-->
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: No possibility to specify "index" on the foreign k
PostPosted: Tue Feb 24, 2009 11:20 am 
Newbie

Joined: Fri Oct 17, 2008 12:45 pm
Posts: 6
Hi,

I want to specify an "index" on the foreign key column EVENT_ID of table SERVER. I couldn't find a solution to accomplish that as the DTD does not allow be to specify an index attribute on the <key> element.

I also tried to add an additional property to the composite-element which also maps to the column EVENT_ID as hibernate allows me to specify the index attribute for the element <property>. But this fails with a mapping exception.

Is there a way to specify an index on the foreign key column of a SET if this set consists of an composite-element?

<set name="server" table="SERVER" lazy="false">
<key column="EVENT_ID" not-null="true"/>
<composite-element class="xxx.Info">
<property name="dnsName" column="DNS_NAME" length="255"/>
<property name="ipAddress" column="IP_ADDRESS"/>
</composite-element>
</set>

Thanks for your help.

Regards,

Christian Schaefer


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 24, 2009 12:00 pm 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
You can place a column-node inside your key-node:
Code:
...
         <key>
            <column name="EVENT_ID" index="yourIndex" />
         </key>

_________________
-----------------
Need advanced help? http://www.viada.eu


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 24, 2009 12:15 pm 
Newbie

Joined: Fri Oct 17, 2008 12:45 pm
Posts: 6
Hey,

thanks a lot! That solved my "index" problems.

Thanks especially for the quick reply!

Regards,

Christian Schaefer


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.