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: relationship on non-key columns
PostPosted: Fri Jan 21, 2005 12:23 pm 
Newbie

Joined: Thu Jan 20, 2005 7:27 pm
Posts: 2
Is there any way to map a relationship between tables on columns that _aren't_ keys? Say I have two tables: Person and Subscriber. These tables both contain the column EMAIL_ADDRESS, and for several reasons they cannot be connected by PK <-> FK. EMAIL_ADDRESS is a non-key column in both tables. How do I map this relationship?

Or, how do I query this without a relationship mapping in HQL with an outer join? Something like this:

Code:
SELECT subscriber, person FROM Subscriber as subscriber, Person as person
LEFT OUTER JOIN person ON subscriber.EmailAddress = person.EmailAddress
[/code]


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.