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: many-to-one relation with formula field
PostPosted: Mon Feb 09, 2009 7:40 am 
Newbie

Joined: Tue Jul 01, 2008 2:37 am
Posts: 15
Hello,

I work with NHibernate 1.2 and I'm having problems trying to do the following:
I want to make a many-to-one relation based on a formula instead of a column.

My problem:
I have table A and table B.
They don't have a direct relationship, but for each A I can get the primary key of B using a function. In my mapping file, I want to configure the relation that way.

Is this possible? Is there any other way to achieve this behaviour?

Regards


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 09, 2009 10:57 am 
Newbie

Joined: Tue Jul 01, 2008 2:37 am
Posts: 15
Addition:

I tried creating a DB View and adding the formula field to it. But now I'm stuck at how to map this to the "default" select of my class (in the mapping file)?


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.