<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: NHibernate, Part II</title>
	<atom:link href="http://www.jaltiere.com/index.php/2008/06/29/nhibernate-part-ii/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jaltiere.com/index.php/2008/06/29/nhibernate-part-ii/</link>
	<description>.NET Software Development</description>
	<lastBuildDate>Mon, 14 Nov 2011 14:58:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Yazid</title>
		<link>http://www.jaltiere.com/index.php/2008/06/29/nhibernate-part-ii/comment-page-1/#comment-48996</link>
		<dc:creator>Yazid</dc:creator>
		<pubDate>Thu, 23 Apr 2009 11:41:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.jaltiere.com/?p=50#comment-48996</guid>
		<description>Hello,

I would like to take to this opportunity to ask a question about one-to-many. I ahve two classes:

GeneralInformation and famousPlacesInLondon

public class GeneralInformation
{

        private int id;

        public virtual int Id
        {
            get { return id; }
            set { id = value; }
        }

        private IList famousPlacesOutLondon;

        public virtual IList FamousPlacesOutLondon
        {
            get { return famousPlacesOutLondon; }
            set { famousPlacesOutLondon = value; }
        }
}

public class FamousPlacesInLondon
{
        private int id;

        public virtual int Id
        {
            get { return id; }
            set { id = value; }
        }
        private string link;

        public virtual string Link
        {
            get { return link; }
            set { link = value; }
        }
        private string title;

        public virtual string Title
        {
            get { return title; }
            set { title = value; }
        }

    }
}

My mapping are as follows:



  
    
      
        
    
      
      
        
  




  
    
      
    
    
        
  


If I fill the GeneralInformation with data and do a save using NHibernate, everything gets inserted into the appropriate table, except the ForeignKey GeneralInformationId. What is wrong?

TIA
Yaz</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>I would like to take to this opportunity to ask a question about one-to-many. I ahve two classes:</p>
<p>GeneralInformation and famousPlacesInLondon</p>
<p>public class GeneralInformation<br />
{</p>
<p>        private int id;</p>
<p>        public virtual int Id<br />
        {<br />
            get { return id; }<br />
            set { id = value; }<br />
        }</p>
<p>        private IList famousPlacesOutLondon;</p>
<p>        public virtual IList FamousPlacesOutLondon<br />
        {<br />
            get { return famousPlacesOutLondon; }<br />
            set { famousPlacesOutLondon = value; }<br />
        }<br />
}</p>
<p>public class FamousPlacesInLondon<br />
{<br />
        private int id;</p>
<p>        public virtual int Id<br />
        {<br />
            get { return id; }<br />
            set { id = value; }<br />
        }<br />
        private string link;</p>
<p>        public virtual string Link<br />
        {<br />
            get { return link; }<br />
            set { link = value; }<br />
        }<br />
        private string title;</p>
<p>        public virtual string Title<br />
        {<br />
            get { return title; }<br />
            set { title = value; }<br />
        }</p>
<p>    }<br />
}</p>
<p>My mapping are as follows:</p>
<p>If I fill the GeneralInformation with data and do a save using NHibernate, everything gets inserted into the appropriate table, except the ForeignKey GeneralInformationId. What is wrong?</p>
<p>TIA<br />
Yaz</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivan Prazov</title>
		<link>http://www.jaltiere.com/index.php/2008/06/29/nhibernate-part-ii/comment-page-1/#comment-46445</link>
		<dc:creator>Ivan Prazov</dc:creator>
		<pubDate>Tue, 13 Jan 2009 22:12:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.jaltiere.com/?p=50#comment-46445</guid>
		<description>http://www.koloskmv.ru/</description>
		<content:encoded><![CDATA[<p><a href="http://www.koloskmv.ru/" rel="nofollow">http://www.koloskmv.ru/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jilia</title>
		<link>http://www.jaltiere.com/index.php/2008/06/29/nhibernate-part-ii/comment-page-1/#comment-29780</link>
		<dc:creator>Jilia</dc:creator>
		<pubDate>Thu, 10 Jul 2008 11:25:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.jaltiere.com/?p=50#comment-29780</guid>
		<description>Yes I tried that.. but what happens when you want to update the fields of the User ??? I did it and the query that is produced is like ... &#039;update User set... where ClientId=?&#039;.
But the ClientId is not the unique id of the User table (the unique id is another field which I call UserId). 
I see that NHibernate does the update based on the key that connects these 2 classes, the ClientId...
I dont know if I make sense...</description>
		<content:encoded><![CDATA[<p>Yes I tried that.. but what happens when you want to update the fields of the User ??? I did it and the query that is produced is like &#8230; &#8216;update User set&#8230; where ClientId=?&#8217;.<br />
But the ClientId is not the unique id of the User table (the unique id is another field which I call UserId).<br />
I see that NHibernate does the update based on the key that connects these 2 classes, the ClientId&#8230;<br />
I dont know if I make sense&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jack Altiere</title>
		<link>http://www.jaltiere.com/index.php/2008/06/29/nhibernate-part-ii/comment-page-1/#comment-29716</link>
		<dc:creator>Jack Altiere</dc:creator>
		<pubDate>Wed, 09 Jul 2008 13:47:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.jaltiere.com/?p=50#comment-29716</guid>
		<description>If I understand correctly, it sounds like you have the same sort of inheritance that I used in my example.  I think that you want to put a joined-subclass entry in your Client mapping file, similiar to what I did above in my Contact class.</description>
		<content:encoded><![CDATA[<p>If I understand correctly, it sounds like you have the same sort of inheritance that I used in my example.  I think that you want to put a joined-subclass entry in your Client mapping file, similiar to what I did above in my Contact class.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jilia</title>
		<link>http://www.jaltiere.com/index.php/2008/06/29/nhibernate-part-ii/comment-page-1/#comment-29713</link>
		<dc:creator>Jilia</dc:creator>
		<pubDate>Wed, 09 Jul 2008 13:25:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.jaltiere.com/?p=50#comment-29713</guid>
		<description>Hello... great article!!!

I need some help... I have a class Client with various properties like phone, name, address etc...
I also have a User class which I want to inherit from Client... so the db tables have a unique id for Client and User. The User tbl also has a ClientId which helps connect them... 

How do I make such inheritance in NHibernate???

Thank you very much!</description>
		<content:encoded><![CDATA[<p>Hello&#8230; great article!!!</p>
<p>I need some help&#8230; I have a class Client with various properties like phone, name, address etc&#8230;<br />
I also have a User class which I want to inherit from Client&#8230; so the db tables have a unique id for Client and User. The User tbl also has a ClientId which helps connect them&#8230; </p>
<p>How do I make such inheritance in NHibernate???</p>
<p>Thank you very much!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

