<?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: Strategies and discriminators in NHibernate</title>
	<atom:link href="http://lostechies.com/jimmybogard/2008/08/27/strategies-and-discriminators-in-nhibernate/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/jimmybogard/2008/08/27/strategies-and-discriminators-in-nhibernate/</link>
	<description>Strong opinions, weakly held</description>
	<lastBuildDate>Thu, 23 May 2013 23:40:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: matt kocaj</title>
		<link>http://lostechies.com/jimmybogard/2008/08/27/strategies-and-discriminators-in-nhibernate/#comment-4593</link>
		<dc:creator>matt kocaj</dc:creator>
		<pubDate>Mon, 07 May 2012 03:31:00 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/08/26/strategies-and-discriminators-in-nhibernate.aspx#comment-4593</guid>
		<description>Hey Jimmy,

I can&#039;t get this method working for me. The line  is giving me trouble.

I get the exception: NHibernate.MappingException: persistent class 
PricingStrategy+FullPriceStrategy not found.

Any ideas?</description>
		<content:encoded><![CDATA[<p>Hey Jimmy,</p>
<p>I can&#8217;t get this method working for me. The line  is giving me trouble.</p>
<p>I get the exception: NHibernate.MappingException: persistent class <br />
PricingStrategy+FullPriceStrategy not found.</p>
<p>Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://lostechies.com/jimmybogard/2008/08/27/strategies-and-discriminators-in-nhibernate/#comment-3963</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 29 Sep 2011 12:28:00 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/08/26/strategies-and-discriminators-in-nhibernate.aspx#comment-3963</guid>
		<description>Hmmm not sure, have you tried asking this question on the NH users mailing list? You&#039;re sure to get someone to answer there.</description>
		<content:encoded><![CDATA[<p>Hmmm not sure, have you tried asking this question on the NH users mailing list? You&#8217;re sure to get someone to answer there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rupeshmehta</title>
		<link>http://lostechies.com/jimmybogard/2008/08/27/strategies-and-discriminators-in-nhibernate/#comment-3962</link>
		<dc:creator>Rupeshmehta</dc:creator>
		<pubDate>Wed, 28 Sep 2011 15:13:00 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/08/26/strategies-and-discriminators-in-nhibernate.aspx#comment-3962</guid>
		<description>Hello I have a question  , I will appreciate if you can help me.

I have following classes with mentioned properties. GLLegalEntity is the base class, in Hibernate I am discriminating 2 subclass on column Dimension ( if Dimension =1 then Cost Center if 2 then Account ) , now I want to Discriminate this subclass as well on certain field , let say TargetLedger , if( TargetLedger=&quot;SAP&quot; then SAPCostCenter , TargetLedger=&quot;Insight&quot; then InsighCostCenter )

GLLegalEntity
- Attribute1
-Attribute2

CostCenter : GLLegalEntity
- Attribute3

SAPCostCenter : CostCenter
-Attribute4

InsighCostCenter
-Attribute5


Account: GLLegalEntity
-Attribute6


Mapping file


                                                                                                                                                  




I am not sure How to Discriminate sub class. As there is no tag called discrimator in subclass.

Can you please help me ? appreciate your help.
</description>
		<content:encoded><![CDATA[<p>Hello I have a question  , I will appreciate if you can help me.</p>
<p>I have following classes with mentioned properties. GLLegalEntity is the base class, in Hibernate I am discriminating 2 subclass on column Dimension ( if Dimension =1 then Cost Center if 2 then Account ) , now I want to Discriminate this subclass as well on certain field , let say TargetLedger , if( TargetLedger=&#8221;SAP&#8221; then SAPCostCenter , TargetLedger=&#8221;Insight&#8221; then InsighCostCenter )</p>
<p>GLLegalEntity<br />
- Attribute1<br />
-Attribute2</p>
<p>CostCenter : GLLegalEntity<br />
- Attribute3</p>
<p>SAPCostCenter : CostCenter<br />
-Attribute4</p>
<p>InsighCostCenter<br />
-Attribute5</p>
<p>Account: GLLegalEntity<br />
-Attribute6</p>
<p>Mapping file</p>
<p>                                                                                                                                                  </p>
<p>I am not sure How to Discriminate sub class. As there is no tag called discrimator in subclass.</p>
<p>Can you please help me ? appreciate your help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dario-g</title>
		<link>http://lostechies.com/jimmybogard/2008/08/27/strategies-and-discriminators-in-nhibernate/#comment-841</link>
		<dc:creator>dario-g</dc:creator>
		<pubDate>Tue, 16 Feb 2010 11:17:53 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/08/26/strategies-and-discriminators-in-nhibernate.aspx#comment-841</guid>
		<description>Hi
Can you look at my question at SO?

I send to you info through the &quot;Contact Me&quot; but with no effect. :(</description>
		<content:encoded><![CDATA[<p>Hi<br />
Can you look at my question at SO?</p>
<p>I send to you info through the &#8220;Contact Me&#8221; but with no effect. <img src='http://lostechies.com/jimmybogard/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jimmy Bogard</title>
		<link>http://lostechies.com/jimmybogard/2008/08/27/strategies-and-discriminators-in-nhibernate/#comment-840</link>
		<dc:creator>Jimmy Bogard</dc:creator>
		<pubDate>Sat, 25 Oct 2008 19:23:41 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/08/26/strategies-and-discriminators-in-nhibernate.aspx#comment-840</guid>
		<description>@Scott

Can you email me through the &quot;Contact Me&quot; link, I&#039;ll send it right over!</description>
		<content:encoded><![CDATA[<p>@Scott</p>
<p>Can you email me through the &#8220;Contact Me&#8221; link, I&#8217;ll send it right over!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Millett</title>
		<link>http://lostechies.com/jimmybogard/2008/08/27/strategies-and-discriminators-in-nhibernate/#comment-839</link>
		<dc:creator>Scott Millett</dc:creator>
		<pubDate>Mon, 13 Oct 2008 14:05:44 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/08/26/strategies-and-discriminators-in-nhibernate.aspx#comment-839</guid>
		<description>Hi Jimmy,

Could you possibly post the corresponding NHibernate mapping for the Product entity?

Cheers
Scott</description>
		<content:encoded><![CDATA[<p>Hi Jimmy,</p>
<p>Could you possibly post the corresponding NHibernate mapping for the Product entity?</p>
<p>Cheers<br />
Scott</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Lieser</title>
		<link>http://lostechies.com/jimmybogard/2008/08/27/strategies-and-discriminators-in-nhibernate/#comment-838</link>
		<dc:creator>Stefan Lieser</dc:creator>
		<pubDate>Fri, 29 Aug 2008 17:39:12 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/08/26/strategies-and-discriminators-in-nhibernate.aspx#comment-838</guid>
		<description>@Jimmy

Thats a good I idea, I will try that.

Thanks!
Stefan</description>
		<content:encoded><![CDATA[<p>@Jimmy</p>
<p>Thats a good I idea, I will try that.</p>
<p>Thanks!<br />
Stefan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jimmy Bogard</title>
		<link>http://lostechies.com/jimmybogard/2008/08/27/strategies-and-discriminators-in-nhibernate/#comment-837</link>
		<dc:creator>Jimmy Bogard</dc:creator>
		<pubDate>Fri, 29 Aug 2008 11:59:43 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/08/26/strategies-and-discriminators-in-nhibernate.aspx#comment-837</guid>
		<description>@Stefan

The other way to approach this is UserTypes.  You create a custom NHibernate-persistable type, and then don&#039;t use discriminators.  You&#039;ll have to put the factory logic inside the UserType.</description>
		<content:encoded><![CDATA[<p>@Stefan</p>
<p>The other way to approach this is UserTypes.  You create a custom NHibernate-persistable type, and then don&#8217;t use discriminators.  You&#8217;ll have to put the factory logic inside the UserType.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Lieser</title>
		<link>http://lostechies.com/jimmybogard/2008/08/27/strategies-and-discriminators-in-nhibernate/#comment-836</link>
		<dc:creator>Stefan Lieser</dc:creator>
		<pubDate>Fri, 29 Aug 2008 09:09:07 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/08/26/strategies-and-discriminators-in-nhibernate.aspx#comment-836</guid>
		<description>@Ninja

Yes that&#039;s the way we do it (ID on products table). But how do you map this column to the enumeration class? If you use a component mapping you can map the id-column to the id-property of the enumeration class. But then you need a static hashtable in the enumeration class to fill in the other predefined properties that otherwise would come from the lookup table.

Cheers,
Stefan Lieser
</description>
		<content:encoded><![CDATA[<p>@Ninja</p>
<p>Yes that&#8217;s the way we do it (ID on products table). But how do you map this column to the enumeration class? If you use a component mapping you can map the id-column to the id-property of the enumeration class. But then you need a static hashtable in the enumeration class to fill in the other predefined properties that otherwise would come from the lookup table.</p>
<p>Cheers,<br />
Stefan Lieser</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave The Ninja</title>
		<link>http://lostechies.com/jimmybogard/2008/08/27/strategies-and-discriminators-in-nhibernate/#comment-835</link>
		<dc:creator>Dave The Ninja</dc:creator>
		<pubDate>Fri, 29 Aug 2008 08:13:27 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/08/26/strategies-and-discriminators-in-nhibernate.aspx#comment-835</guid>
		<description>@Stefan Lieser

When I have done this in the past, without the lookup table, I have a CONST ID value within the class itself.

See Refactoring by fowler, i think the chapter is &quot;replace conditional with polymorphism&quot;

I would then store the const ID in the, referring to the example above, products table.

Ninja</description>
		<content:encoded><![CDATA[<p>@Stefan Lieser</p>
<p>When I have done this in the past, without the lookup table, I have a CONST ID value within the class itself.</p>
<p>See Refactoring by fowler, i think the chapter is &#8220;replace conditional with polymorphism&#8221;</p>
<p>I would then store the const ID in the, referring to the example above, products table.</p>
<p>Ninja</p>
]]></content:encoded>
	</item>
</channel>
</rss>
