-->
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.  [ 3 posts ] 
Author Message
 Post subject: Problem at mapping composite primary keys. Help!!
PostPosted: Wed Mar 09, 2005 7:51 am 
Beginner
Beginner

Joined: Mon Jan 31, 2005 7:53 am
Posts: 32
Location: Madrid - Spain
Can you please please read this:

http://forum.hibernate.org/viewtopic.php?t=939587

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 7:23 am 
Senior
Senior

Joined: Sun Mar 14, 2004 10:16 am
Posts: 129
Location: Ankara
map the user subscriptions in user mapping file as

<bag name = "subscriptions" table "SUBS..">
<key-column = "UserID "
<many-to-many class ="Thirdparties" column="ThirdPartyID">
</bag>

_________________
-developer


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 7:31 am 
Beginner
Beginner

Joined: Mon Jan 31, 2005 7:53 am
Posts: 32
Location: Madrid - Spain
Thank you very much for you reply borak. Although I have no doubt what you say works, I've just found another solution to my problem.

The mapping I've done is:

Code:
<set
            name="setOfSubscription"
            table="CORE_SUBSCRIPTION"
            lazy="false"
            inverse="true"
            cascade="none"
            sort="unsorted"
        >

              <key
                  column="THIRD_PARTY_ID"
              >
              </key>

              <element
                  column="USER_ID"
                  type="java.lang.Long"
                  length="10"
                  not-null="true"
                  unique="true"
              />

</set>


Thank you very much for the time you've spent in solving my problem. Really thanks!!

:)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.