-->
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: Entity associations using <map> and IDictionary (Hasht
PostPosted: Thu Jan 05, 2006 10:49 am 
Beginner
Beginner

Joined: Fri Dec 23, 2005 6:05 am
Posts: 42
Hello,

I am trying to map two Hashtables using a unidirectional <map>.
For valuetype mapping i would use something like this:


Code:
...
   <class name="Demo.Parent, Demo" table="parent">
      <id name="Id" column="demoId" type="Int32">
         <generator class="native" />
      </id>
      <map name="childOne" lazy="true" table="childs">
         <key column="childOneID" />
         <index column="childOneKEY" type="String" />
         <element type="String" column ="childOneVALUE" not-null ="false" />
      </map>
      <map name="childTwo" lazy="true" table="childs">
         <key column="childTwoID" />
         <index column="childTwoKEY" type="String" />
         <element type="String" column ="childTwoVALUE" not-null ="false" />
      </map>
   </class>
...

But what must I do if I want to use objetcs as KEYs or/and VALUEs?

thx

eg


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 1:48 pm 
Expert
Expert

Joined: Fri May 13, 2005 11:13 am
Posts: 292
Location: Rochester, NY
I'm surprised noone responded to this, since it's pretty easy. By "key" and "value" I assume you mean the key and value ofthe IDictionary in question. See section 6.3 of the Hibernate 2.1 docs. Specifically the <index-many-to-many> and <many-to-many> elements.


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.