<?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 CodeCamp Talk &#8211; Source Code</title>
	<atom:link href="http://blog.brianhartsock.com/2009/10/04/nhibernate-codecamp-talk-source-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.brianhartsock.com/2009/10/04/nhibernate-codecamp-talk-source-code/</link>
	<description>The exciting life of a software developer and nerd</description>
	<lastBuildDate>Thu, 29 Jul 2010 02:49:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Brian O'Neil</title>
		<link>http://blog.brianhartsock.com/2009/10/04/nhibernate-codecamp-talk-source-code/comment-page-1/#comment-881</link>
		<dc:creator>Brian O'Neil</dc:creator>
		<pubDate>Tue, 06 Oct 2009 21:03:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.brianhartsock.com/?p=958#comment-881</guid>
		<description>Thanks so much! I would have never thought the mapping was at work here. I should have listened better. 
All good now.</description>
		<content:encoded><![CDATA[<p>Thanks so much! I would have never thought the mapping was at work here. I should have listened better.<br />
All good now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bhartsock</title>
		<link>http://blog.brianhartsock.com/2009/10/04/nhibernate-codecamp-talk-source-code/comment-page-1/#comment-880</link>
		<dc:creator>bhartsock</dc:creator>
		<pubDate>Tue, 06 Oct 2009 14:40:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.brianhartsock.com/?p=958#comment-880</guid>
		<description>That&#039;s because NHibernate uses the setter to set the value.  It is possible to change this behavior though.

http://nhforge.org/doc/nh/en/index.html#mapping-declaration-property

Read the access/naming strategies section.  This will tell NHibernate how to access the property.

&lt;property name=&quot;EmployerName&quot; access=&quot;nosetter.camelcase-underscore&quot; /&gt;

This will tell NHibernate, don&#039;t use the setter, instead use the field that is the camel-cased version of the property name, prefixed with an underscore.

Make sense?  It&#039;s a weird syntax, but it works like a charm.</description>
		<content:encoded><![CDATA[<p>That&#8217;s because NHibernate uses the setter to set the value.  It is possible to change this behavior though.</p>
<p><a href="http://nhforge.org/doc/nh/en/index.html#mapping-declaration-property" rel="nofollow">http://nhforge.org/doc/nh/en/index.html#mapping-declaration-property</a></p>
<p>Read the access/naming strategies section.  This will tell NHibernate how to access the property.</p>
<p>&lt;property name=&#8221;EmployerName&#8221; access=&#8221;nosetter.camelcase-underscore&#8221; /&gt;</p>
<p>This will tell NHibernate, don&#8217;t use the setter, instead use the field that is the camel-cased version of the property name, prefixed with an underscore.</p>
<p>Make sense?  It&#8217;s a weird syntax, but it works like a charm.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian O'Neil</title>
		<link>http://blog.brianhartsock.com/2009/10/04/nhibernate-codecamp-talk-source-code/comment-page-1/#comment-879</link>
		<dc:creator>Brian O'Neil</dc:creator>
		<pubDate>Tue, 06 Oct 2009 14:32:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.brianhartsock.com/?p=958#comment-879</guid>
		<description>Sure... here is a chunk of the entity (created by MyGeneration) where you can how IsChanged is effected by the public property setter:

public virtual string EmployerName
{
get { return _employerName; }
set { _isChanged &#124;= (_employerName != value); _employerName = value; }
}

Mapping of that column is really irrelevant, but here it is for context :

@lt;property type=&quot;string&quot; length=&quot;50&quot; name=&quot;EmployerName&quot; column=&quot;`EmployerName`&quot; /@gt;


A quick way to see what is happening, is just set a breakpoint in one of your entities public setters and call List@lt;@gt; on it.

Thanks again</description>
		<content:encoded><![CDATA[<p>Sure&#8230; here is a chunk of the entity (created by MyGeneration) where you can how IsChanged is effected by the public property setter:</p>
<p>public virtual string EmployerName<br />
{<br />
get { return _employerName; }<br />
set { _isChanged |= (_employerName != value); _employerName = value; }<br />
}</p>
<p>Mapping of that column is really irrelevant, but here it is for context :</p>
<p>@lt;property type=&#8221;string&#8221; length=&#8221;50&#8243; name=&#8221;EmployerName&#8221; column=&#8221;`EmployerName`&#8221; /@gt;</p>
<p>A quick way to see what is happening, is just set a breakpoint in one of your entities public setters and call List@lt;@gt; on it.</p>
<p>Thanks again</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bhartsock</title>
		<link>http://blog.brianhartsock.com/2009/10/04/nhibernate-codecamp-talk-source-code/comment-page-1/#comment-875</link>
		<dc:creator>bhartsock</dc:creator>
		<pubDate>Mon, 05 Oct 2009 17:00:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.brianhartsock.com/?p=958#comment-875</guid>
		<description>Do have some sample source code I could look at, maybe a small piece or some psuedo code.  If I could see the code, the query, and the mappings, I might be able to help a little bit.</description>
		<content:encoded><![CDATA[<p>Do have some sample source code I could look at, maybe a small piece or some psuedo code.  If I could see the code, the query, and the mappings, I might be able to help a little bit.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian O'Neil</title>
		<link>http://blog.brianhartsock.com/2009/10/04/nhibernate-codecamp-talk-source-code/comment-page-1/#comment-874</link>
		<dc:creator>Brian O'Neil</dc:creator>
		<pubDate>Mon, 05 Oct 2009 16:21:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.brianhartsock.com/?p=958#comment-874</guid>
		<description>Thanks for the great talk on NHibernate at Richmond!

I have a followup question. It appears to me that NHibernate is setting &quot;IsChanged&quot; equal to True upon a call to &quot;List&quot;. As you may expect this renders that property useless for change tracking. From my experience with CSLA, there is usually a way to tell if the property is being changed during Load or upon a user of the object actually changing something. &quot;Dirty&quot; was never the case after a &quot;Fetch&quot; from the database, because a local variable was set for each column, not using the public Setter method.

Do you see this same behavior? 

Thanks again,
Brian</description>
		<content:encoded><![CDATA[<p>Thanks for the great talk on NHibernate at Richmond!</p>
<p>I have a followup question. It appears to me that NHibernate is setting &#8220;IsChanged&#8221; equal to True upon a call to &#8220;List&#8221;. As you may expect this renders that property useless for change tracking. From my experience with CSLA, there is usually a way to tell if the property is being changed during Load or upon a user of the object actually changing something. &#8220;Dirty&#8221; was never the case after a &#8220;Fetch&#8221; from the database, because a local variable was set for each column, not using the public Setter method.</p>
<p>Do you see this same behavior? </p>
<p>Thanks again,<br />
Brian</p>
]]></content:encoded>
	</item>
</channel>
</rss>
