-->
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.  [ 6 posts ] 
Author Message
 Post subject: Composite Key mapping issue
PostPosted: Fri Jun 04, 2004 11:42 am 
Newbie

Joined: Fri Jun 04, 2004 11:34 am
Posts: 5
Hello all, I've been struggling for a while now with how to setup a relationship. I have two objects, one being a Listing object, the other a Tax object. The relationship is a one-to-one (not constrained). The primary keys for each are as follows:
Code:
Listing = mlsID (String) + associationID (long)
Taxes = associationID (long) + taxID (string)

I have the
Code:
taxID
also in the Listing object. I've looked through all the documentation for Hibernate 1.2 and can't seem to find anyway to let hibernate handle the relationship of these two objects for me. Mostly I am interested in cascade deletes. Anyone have any thoughts as to how I should approach this? If I can't find a way then I will have to handle the relationship manually but would really like to avoid that.

Much much thanks in advance,
-Jay


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 04, 2004 11:46 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
just use key-many-to-one from Listing to Taxes or Taxes to Listing

it will do what you need

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 04, 2004 11:48 am 
Newbie

Joined: Fri Jun 04, 2004 11:34 am
Posts: 5
Thank you for the extremely quick response. I will definitely check into it.

-Jay


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 04, 2004 12:16 pm 
Newbie

Joined: Fri Jun 04, 2004 11:34 am
Posts: 5
Is the key-many-to-one compatible with hibernate 1.2? I dont see it listed in the DTD

Thanks,
-Jay


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 04, 2004 12:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
No it is not.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 04, 2004 12:47 pm 
Newbie

Joined: Fri Jun 04, 2004 11:34 am
Posts: 5
Figured... I have been avoiding the migration to 2.0 because it's going to cause some major headaches. Guess I have no choice now.

Thanks again,
-Jay


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