<?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: Summer of NHibernate Session 07: Exploring m:n Relationships, Views, and Components</title>
	<atom:link href="http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/feed/" rel="self" type="application/rss+xml" />
	<link>http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/</link>
	<description>Miscellaneous musings on life, .NET development, and related things that don't really matter</description>
	<pubDate>Thu, 17 May 2012 21:13:26 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: GarethWyett</title>
		<link>http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/comment-page-1/#comment-59267</link>
		<dc:creator>GarethWyett</dc:creator>
		<pubDate>Tue, 18 Jan 2011 06:51:57 +0000</pubDate>
		<guid isPermaLink="false">http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/#comment-59267</guid>
		<description>Elo, I'm a newby. Thought I'd say hi.

Take care and Thanks alot

(sorry  if the  wrong place to post)</description>
		<content:encoded><![CDATA[<p>Elo, I&#8217;m a newby. Thought I&#8217;d say hi.</p>
<p>Take care and Thanks alot</p>
<p>(sorry  if the  wrong place to post)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sbohlen</title>
		<link>http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/comment-page-1/#comment-24873</link>
		<dc:creator>sbohlen</dc:creator>
		<pubDate>Thu, 03 Dec 2009 13:03:35 +0000</pubDate>
		<guid isPermaLink="false">http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/#comment-24873</guid>
		<description>@Sorin:

If your need is urgent, you might have better luck on the NHUsers forum where there are more people can assist you ( http://groups.google.com/group/nhusers ).

I can advise in advance that you're going to need to be able to provide some or all of the following in order for either myself or anyone else to be able to assist you:

* class file(s) for persisted objects
* mapping (.hbm) files for objects

Best of luck~!

-Steve B.</description>
		<content:encoded><![CDATA[<p>@Sorin:</p>
<p>If your need is urgent, you might have better luck on the NHUsers forum where there are more people can assist you ( <a href="http://groups.google.com/group/nhusers" rel="nofollow">http://groups.google.com/group/nhusers</a> ).</p>
<p>I can advise in advance that you&#8217;re going to need to be able to provide some or all of the following in order for either myself or anyone else to be able to assist you:</p>
<p>* class file(s) for persisted objects<br />
* mapping (.hbm) files for objects</p>
<p>Best of luck~!</p>
<p>-Steve B.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sorin</title>
		<link>http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/comment-page-1/#comment-24830</link>
		<dc:creator>Sorin</dc:creator>
		<pubDate>Wed, 02 Dec 2009 21:53:15 +0000</pubDate>
		<guid isPermaLink="false">http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/#comment-24830</guid>
		<description>Hi there. I'm following your videos and trying to learn NHibernate.
I'm trying to use NHibernate with a MS Access DB. I've got the basics building, but when it comes to a many-to-many relationship I get some strange exception messages.
Let's take your many-to-many example. You have there the tables Order, OrderProduct and Product. I have similar tables. I've made the hbm.xml files and the classes exactly the same as you did, everything compiling. I'm retrieving an order from the DB by the Id, but when I'm trying to see, let's say, all products in a given order, I get this message when looking to the Products collection of the Order class:

{"could not initialize a collection: [FECCGe.Core.Student.Domains#1][SQL: SELECT domains0_.ID_Student as ID2_1_, domains0_.ID_Materie as ID1_1_, domain1_.ID_Materie as ID1_1_0_, domain1_.Materie as Materie1_0_, domain1_.ID_Specializare as ID3_1_0_, domain1_.AnUniversitar as AnUniver4_1_0_ FROM Student_Materie domains0_ left outer join Materie domain1_ on domains0_.ID_Materie=domain1_.ID_Materie WHERE domains0_.ID_Student=?]"}	System.Exception {NHibernate.Exceptions.GenericADOException}
and it's inner exception message is : "No value given for one or more required parameters." and as you see for yourself, I don't parse anything for the ID_Student column.

The way I'm retrieving the Order (like in your example) is this : 
            return _session.Get(studentId);

Do you know what's wrong or am I doing something wrong with NHibernate.

Please answer, it's kind of urgent ! :)</description>
		<content:encoded><![CDATA[<p>Hi there. I&#8217;m following your videos and trying to learn NHibernate.<br />
I&#8217;m trying to use NHibernate with a MS Access DB. I&#8217;ve got the basics building, but when it comes to a many-to-many relationship I get some strange exception messages.<br />
Let&#8217;s take your many-to-many example. You have there the tables Order, OrderProduct and Product. I have similar tables. I&#8217;ve made the hbm.xml files and the classes exactly the same as you did, everything compiling. I&#8217;m retrieving an order from the DB by the Id, but when I&#8217;m trying to see, let&#8217;s say, all products in a given order, I get this message when looking to the Products collection of the Order class:</p>
<p>{&#8221;could not initialize a collection: [FECCGe.Core.Student.Domains#1][SQL: SELECT domains0_.ID_Student as ID2_1_, domains0_.ID_Materie as ID1_1_, domain1_.ID_Materie as ID1_1_0_, domain1_.Materie as Materie1_0_, domain1_.ID_Specializare as ID3_1_0_, domain1_.AnUniversitar as AnUniver4_1_0_ FROM Student_Materie domains0_ left outer join Materie domain1_ on domains0_.ID_Materie=domain1_.ID_Materie WHERE domains0_.ID_Student=?]&#8220;}	System.Exception {NHibernate.Exceptions.GenericADOException}<br />
and it&#8217;s inner exception message is : &#8220;No value given for one or more required parameters.&#8221; and as you see for yourself, I don&#8217;t parse anything for the ID_Student column.</p>
<p>The way I&#8217;m retrieving the Order (like in your example) is this :<br />
            return _session.Get(studentId);</p>
<p>Do you know what&#8217;s wrong or am I doing something wrong with NHibernate.</p>
<p>Please answer, it&#8217;s kind of urgent ! <img src='http://unhandled-exceptions.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Websites tagged "antipattern" on Postsaver</title>
		<link>http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/comment-page-1/#comment-12060</link>
		<dc:creator>Websites tagged "antipattern" on Postsaver</dc:creator>
		<pubDate>Fri, 20 Mar 2009 14:47:14 +0000</pubDate>
		<guid isPermaLink="false">http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/#comment-12060</guid>
		<description>[...] day 1: An Open Source Project Called “Failure:” Community ... saved by tkoudsi2009-03-13 - Summer of NHibernate Session 07: Exploring m:n Relationships ... saved by htrstaff2009-03-12 - Joining the Mobile Computing Masses; Visual Studio 2005 and Vista [...]</description>
		<content:encoded><![CDATA[<p>[...] day 1: An Open Source Project Called “Failure:” Community &#8230; saved by tkoudsi2009-03-13 - Summer of NHibernate Session 07: Exploring m:n Relationships &#8230; saved by htrstaff2009-03-12 - Joining the Mobile Computing Masses; Visual Studio 2005 and Vista [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sbohlen</title>
		<link>http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/comment-page-1/#comment-1594</link>
		<dc:creator>sbohlen</dc:creator>
		<pubDate>Fri, 19 Sep 2008 14:20:23 +0000</pubDate>
		<guid isPermaLink="false">http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/#comment-1594</guid>
		<description>@Billy:

You are (I think) in luck.  Step 1 you have already identified as being to make the default (empty) constructor private.  Step 2 however is to do something that I didn't begin to go into in any of the screencasts: tell nhib to use the private backing fields for your properties instead of the properties themselves.

You need a combination of access="field" on your property, id, etc. tags and also investigate 'naming strategies' so that nhib can properly deduce the name of your backing fields from your property names.  This set of steps will allow nhib to access your underlying private data members NOT via your property accessors.</description>
		<content:encoded><![CDATA[<p>@Billy:</p>
<p>You are (I think) in luck.  Step 1 you have already identified as being to make the default (empty) constructor private.  Step 2 however is to do something that I didn&#8217;t begin to go into in any of the screencasts: tell nhib to use the private backing fields for your properties instead of the properties themselves.</p>
<p>You need a combination of access=&#8221;field&#8221; on your property, id, etc. tags and also investigate &#8216;naming strategies&#8217; so that nhib can properly deduce the name of your backing fields from your property names.  This set of steps will allow nhib to access your underlying private data members NOT via your property accessors.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Billy Stack</title>
		<link>http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/comment-page-1/#comment-1591</link>
		<dc:creator>Billy Stack</dc:creator>
		<pubDate>Fri, 19 Sep 2008 13:36:51 +0000</pubDate>
		<guid isPermaLink="false">http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/#comment-1591</guid>
		<description>Hi Steve,

This screencast touches immutability a little so here is the most apt place to ask the following question:

I am currently tasked with introducing NHibernate into our codebase. All of our business domain objects are immutable and take the following format:

public class SampleEntity
{
    public readonly int SampleProperty;
    public readonly string SampleProperty2;
    
    public SampleEntity(int sp1, string sp2)
    {
        this.SampleProperty = sp1;
        this.SampleProperty2 = sp2;
}

From what I can see, we would have to perform the following to make our entites NHibernate compatible but as close as possible to still being immutable "enough":

    1. Add a default constructor (it can be private but still needs to be added)
    2. Take the readonly attribute off all properties and have get; private set; accessibility.

Is there any way to get NHibernate to work with an antity of the type described above?

In my opinion, we shoudnt have to sacrifice our business domain objects "immutability" to cater for an ORM integration.

Also, I know another solution could be to map our immutable business domain entities to NHibernate compatible entities but this in my opinion would be too costly!

So in conclusion , is there a way to get HNibernate to work for "truely" (i.e. using readonly properties) immutable types?</description>
		<content:encoded><![CDATA[<p>Hi Steve,</p>
<p>This screencast touches immutability a little so here is the most apt place to ask the following question:</p>
<p>I am currently tasked with introducing NHibernate into our codebase. All of our business domain objects are immutable and take the following format:</p>
<p>public class SampleEntity<br />
{<br />
    public readonly int SampleProperty;<br />
    public readonly string SampleProperty2;</p>
<p>    public SampleEntity(int sp1, string sp2)<br />
    {<br />
        this.SampleProperty = sp1;<br />
        this.SampleProperty2 = sp2;<br />
}</p>
<p>From what I can see, we would have to perform the following to make our entites NHibernate compatible but as close as possible to still being immutable &#8220;enough&#8221;:</p>
<p>    1. Add a default constructor (it can be private but still needs to be added)<br />
    2. Take the readonly attribute off all properties and have get; private set; accessibility.</p>
<p>Is there any way to get NHibernate to work with an antity of the type described above?</p>
<p>In my opinion, we shoudnt have to sacrifice our business domain objects &#8220;immutability&#8221; to cater for an ORM integration.</p>
<p>Also, I know another solution could be to map our immutable business domain entities to NHibernate compatible entities but this in my opinion would be too costly!</p>
<p>So in conclusion , is there a way to get HNibernate to work for &#8220;truely&#8221; (i.e. using readonly properties) immutable types?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sbohlen</title>
		<link>http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/comment-page-1/#comment-251</link>
		<dc:creator>sbohlen</dc:creator>
		<pubDate>Sat, 16 Aug 2008 11:09:08 +0000</pubDate>
		<guid isPermaLink="false">http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/#comment-251</guid>
		<description>@Nissar:

In comment #22 Wordpress stripped out my thing-in-anglebrackets in that last sentence that was supposed to read "NHhibernate + your-database-here + updateable view".

I keep forgetting that Wordpress just drops anything that contains HTML-style angle brackets :)</description>
		<content:encoded><![CDATA[<p>@Nissar:</p>
<p>In comment #22 Wordpress stripped out my thing-in-anglebrackets in that last sentence that was supposed to read &#8220;NHhibernate + your-database-here + updateable view&#8221;.</p>
<p>I keep forgetting that Wordpress just drops anything that contains HTML-style angle brackets <img src='http://unhandled-exceptions.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sbohlen</title>
		<link>http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/comment-page-1/#comment-250</link>
		<dc:creator>sbohlen</dc:creator>
		<pubDate>Sat, 16 Aug 2008 11:07:02 +0000</pubDate>
		<guid isPermaLink="false">http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/#comment-250</guid>
		<description>@Nisar:

You are correct (sort of).  Various DB platforms have varying support for what are called 'updateable views' where you can actually use a view as a read-write target instead of just a read-only target.  Different DB targets impose different constraints on what must be 'true' for a view to be updateable and still other DB platforms don't support updateable views at all.

Given all this, unless you are 100% certain of the DB your NHib-based app will run against, its really best-practice not to make a design decision (like to depend on updateable views) unless you are willing to sacrifice DB-platform-neutrality (one of the main reasons for selecting and O/RM tool like NHib in the first place).

That said, if you decide that tying your solution to a particular DB target is OK for your app, then google on NHibernate + &lt;your database here&gt; + "updateable view" and you will certainly find plenty of info out there.</description>
		<content:encoded><![CDATA[<p>@Nisar:</p>
<p>You are correct (sort of).  Various DB platforms have varying support for what are called &#8216;updateable views&#8217; where you can actually use a view as a read-write target instead of just a read-only target.  Different DB targets impose different constraints on what must be &#8216;true&#8217; for a view to be updateable and still other DB platforms don&#8217;t support updateable views at all.</p>
<p>Given all this, unless you are 100% certain of the DB your NHib-based app will run against, its really best-practice not to make a design decision (like to depend on updateable views) unless you are willing to sacrifice DB-platform-neutrality (one of the main reasons for selecting and O/RM tool like NHib in the first place).</p>
<p>That said, if you decide that tying your solution to a particular DB target is OK for your app, then google on NHibernate + <your database here> + &#8220;updateable view&#8221; and you will certainly find plenty of info out there.</your></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nisar Khan</title>
		<link>http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/comment-page-1/#comment-242</link>
		<dc:creator>Nisar Khan</dc:creator>
		<pubDate>Sat, 16 Aug 2008 02:55:01 +0000</pubDate>
		<guid isPermaLink="false">http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/#comment-242</guid>
		<description>hi Steve,

if i understood correctly the purpose of using "view" is for "read only"?

great videos and learn a lot and today whole day i was watching your videos and i'm on 8th video now ;)</description>
		<content:encoded><![CDATA[<p>hi Steve,</p>
<p>if i understood correctly the purpose of using &#8220;view&#8221; is for &#8220;read only&#8221;?</p>
<p>great videos and learn a lot and today whole day i was watching your videos and i&#8217;m on 8th video now <img src='http://unhandled-exceptions.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sbohlen</title>
		<link>http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/comment-page-1/#comment-222</link>
		<dc:creator>sbohlen</dc:creator>
		<pubDate>Thu, 14 Aug 2008 23:31:08 +0000</pubDate>
		<guid isPermaLink="false">http://unhandled-exceptions.com/blog/index.php/2008/08/04/summer-of-nhibernate-session-07-exploring-mn-relationships-views-and-components/#comment-222</guid>
		<description>@Michael:

Seems that the angle-brackets from my prior comment (#19) were stripped out of the comment.  The mapping tag that I was TRYING to suggest you investigate there is called 'joined-subclass'.  In the prior post, every time the sentence doesn't seem to make sense, insert the text 'joined-subclass' into the sentence and it will be fine :)

Wordpress seems to want to strip angle-brackets out of comments, presumably to protect me from aberrent HTML entered as comments.</description>
		<content:encoded><![CDATA[<p>@Michael:</p>
<p>Seems that the angle-brackets from my prior comment (#19) were stripped out of the comment.  The mapping tag that I was TRYING to suggest you investigate there is called &#8216;joined-subclass&#8217;.  In the prior post, every time the sentence doesn&#8217;t seem to make sense, insert the text &#8216;joined-subclass&#8217; into the sentence and it will be fine <img src='http://unhandled-exceptions.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Wordpress seems to want to strip angle-brackets out of comments, presumably to protect me from aberrent HTML entered as comments.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

