-->
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: NHibernate many-to-one mapping
PostPosted: Wed Feb 10, 2010 2:25 pm 
Newbie

Joined: Thu Oct 01, 2009 5:38 pm
Posts: 6
Hi All,
I have 2 tables, EF and EFD.
EF table has columns, ID, Definition, DefinitionName and Misc1.
EFD has columns, ID, Program, JobNum, Misc1Label.
Here, Definition is the foreign Key of EF table referring to ID in EFD table.
I want to access the values of EFD table.
<class name="EF">
<id name="ID" type="Int32">
<generator class="native" />
</id>
<many-to-one name="Definition" class="EFD"/>
</class>
I am trying to use Definition.Misc1Label, but it does'nt display anything. Please Help!


Top
 Profile  
 
 Post subject: Re: NHibernate many-to-one mapping
PostPosted: Thu Feb 11, 2010 3:58 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
How do you look at the value ? Via debugger or via GUI (Web/Forms) ? There a few things you can try:

- check your database if there really is a record
- if the debugger shows the value as null , try and disable lazy loading on the many-to-one
- if the value is simply not shown in your GUI, have in mind, that you can't bind to something like "Definition.Misc1Label". DataBinding (at least Windows Forms) does not walk through the property tree
- if all that does not help, try to profile you DB session and check how the query looks like and what is returned.

_________________
--Wolfgang


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.