-->
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: how to map composite-map-key?
PostPosted: Thu Dec 22, 2005 10:46 pm 
Beginner
Beginner

Joined: Tue Nov 01, 2005 5:21 am
Posts: 24
Hi,

I want to map a collection to hashmap.
<map name="topoLinkTerminations" cascade="all" inverse="true" fetch="join">
<key>
<column name="TOPO_LINK_CODE" precision="38" scale="0"
not-null="true" />
</key>
<composite-map-key class="">
<key-property name="propName" column="PROP_NAME"></key-property>
<key-property name="azType" column="A_Z_TYPE"></key-property>
</composite-map-key>
<one-to-many class="TopoLinkTermination" />
</map>

My questions:
1)
Should create a class, for example, CMapKey as following?
class CMapKey implements java.io.Serializable
{
private String propName;
private String azType;
}

2) Is the mapping above a correct one? If not, what's wrong?

Hope someone could help.
Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 23, 2005 8:51 am 
Newbie

Joined: Wed Dec 21, 2005 4:03 pm
Posts: 11
Location: Pittsburgh
Use CMapKey is a much better idea. Just don't forget the getters and setters in the CMapKey class and treat CMapKey instances as a normal id.


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.