-->
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.  [ 1 post ] 
Author Message
 Post subject: Transform set to map
PostPosted: Wed Feb 28, 2007 9:35 am 
Newbie

Joined: Tue Jan 16, 2007 7:34 am
Posts: 9
Hi

I've this generated mapping:

Code:
<set name="nreferences" inverse="true">
           <key>
               <column name="notification_id" not-null="true">
                   <comment></comment>
               </column>
           </key>
           <one-to-many
class="com.xx.xxx.notifications.bl.beans.Nreference" />
       </set>



Is posible to transform it to a map ?

I've tried to do this:

Code:
<class name="com.xx.xxx.Notification" table="notification" catalog="zzzz1">
        <comment></comment>
        <id name="notificationId" type="long">
            <column name="notification_id" />
            <generator class="assigned" />
        </id>
        <map name="nreferences" inverse="true">
            <key>
                <column name="notification_id" not-null="true">
                    <comment></comment>
                </column>
            </key>
            <map-key type="String">
               <column name="ndescription_locale" />
            </map-key>
            <one-to-many class="com.xx.xxx.Nreference" />
        </map>       
    </class>
   
   
<class name="com.xx.xxx.Ndescription" table="ndescription" catalog="zzzz1">
        <comment></comment>
        <composite-id name="id" class="com.xx.xxx.NdescriptionId">
            <key-property name="ndescriptionLocale" type="string">
                <column name="ndescription_locale" length="2" />
            </key-property>
            <key-many-to-one name="notification" class="com.xx.xxx.Notification">
                <column name="notification_id" />
            </key-many-to-one>
        </composite-id>
        <property name="ndescriptionTitle" type="string">
            <column name="ndescription_title" not-null="true">
                <comment></comment>
            </column>
        </property>
        <property name="ndescriptionDescription" type="string">
            <column name="ndescription_description" not-null="true">
                <comment></comment>
            </column>
        </property>
    </class>   



But I'm a little bit confused with my docs reading so, may be a more experienced java user could give me a clue...


Thanks in advance

C


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.