-->
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: "one-to-many" problem while describing Key Columns.
PostPosted: Thu Dec 16, 2010 12:01 pm 
Newbie

Joined: Tue Dec 14, 2010 4:46 am
Posts: 4
I have this problem on "one-to-many" links.

I have two tables, Like "customers" and "orders". and as ordinary, A customer can have many orders.

My problem is, these two tables are not linked through their ID Columns. They have some other ordinary column like "SimilarColumn". How can I link them? I think I must change the property line of "SimilarColumn".

<list name="OrdersListOfCustomer" lazy="false" fetch="subselect" cascade="all" inverse="true">
<key column="SimilarColumn">
</key>
<index column="SimilarColumn"></index>
<one-to-many not-found="ignore" class="OrderNameSpace"></one-to-many>
</list>

This code dont work. I mean, It works fine but not get any data. But when I put "ID" columns instead of "SimilarColumn", it retrieves the correct data.


Top
 Profile  
 
 Post subject: Re: "one-to-many" problem while describing Key Columns.
PostPosted: Fri Dec 17, 2010 7:25 am 
Regular
Regular

Joined: Fri Nov 12, 2010 4:13 am
Posts: 81
Location: India
What is the datatype of similarcolumn in database?

_________________
Thanks & Regards,
Chirag


Top
 Profile  
 
 Post subject: Re: "one-to-many" problem while describing Key Columns.
PostPosted: Fri Dec 17, 2010 8:19 am 
Newbie

Joined: Tue Dec 14, 2010 4:46 am
Posts: 4
Hey Naikec,

Its number. and here is the line on NHibernate:

<property name="SimilarColumn" column="SimilarColumn" type="Int64"/>

It's same on both of the tables.


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.