-->
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: Collection mapping : correct sysntax for using <map>
PostPosted: Wed Jul 13, 2005 12:30 am 
Beginner
Beginner

Joined: Fri Jun 25, 2004 5:31 am
Posts: 31
Hibernate version: 3.0.1

App server: JBoss

Name and version of the database you are using: Oracle 8i



Code:

<map name="product_parts" table="PRODUCT_PART">
       <key column="PRODUCT_CODE" not-null="true"/>       
       <map-key  type="java.lang.String" column="PART_ID" /> 
        <many-to-many  class="eg.Part" column="PART_CODE"/>   
</map>



where:

PRODUCT (PRODUCT_CODE, DESCRIPTION)
PART (PART_CODE, DESCRIPTION)
PRODUCT_PART (PRODUCT_CODE , PART_ID)

Above mapping is in the Product.hbm.xml

I was able to do this with using a Set. But now need to try it with a Map.

This mappin gives an invalid column exception when a query is executed. But there arn't any mapping error at the JBoss start up.

Pls let me know the correct way of mapping this senario also the actual column that needs to be specified as the <map-key> and as the <many-to-many>.

thanks
Shanika


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 18, 2005 10:59 pm 
Beginner
Beginner

Joined: Fri Jun 25, 2004 5:31 am
Posts: 31
Does anybody know how to use the <map-key> and a many-to-many association in a <map> that refers to a pure resolving table?

I'm still waiting for a reply to my previous post.

thanks
Shanika


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.