-->
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: Using index for a map from the other table?
PostPosted: Mon Feb 09, 2004 4:39 pm 
Newbie

Joined: Sun Jan 25, 2004 2:35 pm
Posts: 5
Hello,

I have the following mapping:

Code:
<class name="Template" table="Template">
   
      <id name="id" column="idTemplate">
         <generator class="increment"/>
      </id>
     
      <map name="SingleContainers" table="Template_SingleContainer">
         <index column="name" type="string"/>
         <key column="idTemplate"/>
         <many-to-many class="SingleContainer"   
            column="idSingleContainer"/>
      </map>
</class>


I want to use the name value from SingleContainer as key for the map. How to do that? Should I better user <index-many-to-many/>? But how?

Please help me.

Thank you.

Regards
Stephan


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 09, 2004 5:59 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
This should be as easy as setting inverse="true". Perhaps you should show more complete mappings...


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.