<?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: Using Fluent NHibernate in Spring.Net</title>
	<atom:link href="http://blog.bennymichielsen.be/2009/01/04/using-fluent-nhibernate-in-spring-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bennymichielsen.be/2009/01/04/using-fluent-nhibernate-in-spring-net/</link>
	<description>.net developer with a touch of Cocoa</description>
	<lastBuildDate>Sat, 03 Dec 2011 15:56:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Amr Ellafy</title>
		<link>http://blog.bennymichielsen.be/2009/01/04/using-fluent-nhibernate-in-spring-net/#comment-257</link>
		<dc:creator>Amr Ellafy</dc:creator>
		<pubDate>Mon, 28 Nov 2011 08:16:01 +0000</pubDate>
		<guid isPermaLink="false">/post/2009/01/04/Using-Fluent-NHibernate-in-SpringNet.aspx#comment-257</guid>
		<description>here is the implementation if you are using FluentNhibernate auto mapping :

protected override void PostProcessConfiguration(Configuration config)
        {
            base.PostProcessConfiguration(config);

            var autoMappingCfg = new AutoMappingConfiguration();

            var autoMap = AutoMap.AssemblyOf(autoMappingCfg)
                                 .Conventions.Add(DefaultCascade.All(), DefaultLazy.Never())
                                 .Conventions.Add()
                                 .Override(map =&gt; { map.IgnoreProperty(i =&gt; i.Total); });

            Fluently.Configure(config)
                    .Mappings(m =&gt; m.AutoMappings.Add(autoMap))
                    .BuildConfiguration();
        }

in outmapping you don&#039;t need to inject FluentNhibernateMappingAssemblies. so configure Sping.Net accordingly</description>
		<content:encoded><![CDATA[<p>here is the implementation if you are using FluentNhibernate auto mapping :</p>
<p>protected override void PostProcessConfiguration(Configuration config)<br />
        {<br />
            base.PostProcessConfiguration(config);</p>
<p>            var autoMappingCfg = new AutoMappingConfiguration();</p>
<p>            var autoMap = AutoMap.AssemblyOf(autoMappingCfg)<br />
                                 .Conventions.Add(DefaultCascade.All(), DefaultLazy.Never())<br />
                                 .Conventions.Add()<br />
                                 .Override(map =&gt; { map.IgnoreProperty(i =&gt; i.Total); });</p>
<p>            Fluently.Configure(config)<br />
                    .Mappings(m =&gt; m.AutoMappings.Add(autoMap))<br />
                    .BuildConfiguration();<br />
        }</p>
<p>in outmapping you don&#8217;t need to inject FluentNhibernateMappingAssemblies. so configure Sping.Net accordingly</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jessie Veitenheimer</title>
		<link>http://blog.bennymichielsen.be/2009/01/04/using-fluent-nhibernate-in-spring-net/#comment-120</link>
		<dc:creator>Jessie Veitenheimer</dc:creator>
		<pubDate>Thu, 02 Jun 2011 05:38:37 +0000</pubDate>
		<guid isPermaLink="false">/post/2009/01/04/Using-Fluent-NHibernate-in-SpringNet.aspx#comment-120</guid>
		<description>An neat submit appropriate there mate . Thanks for submitting .</description>
		<content:encoded><![CDATA[<p>An neat submit appropriate there mate . Thanks for submitting .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://blog.bennymichielsen.be/2009/01/04/using-fluent-nhibernate-in-spring-net/#comment-48</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Sun, 29 Aug 2010 11:40:23 +0000</pubDate>
		<guid isPermaLink="false">/post/2009/01/04/Using-Fluent-NHibernate-in-SpringNet.aspx#comment-48</guid>
		<description>Funny that you post a link to stackoverflow with a solution I provided :)</description>
		<content:encoded><![CDATA[<p>Funny that you post a link to stackoverflow with a solution I provided <img src='http://blog.bennymichielsen.be/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexandre Bonte</title>
		<link>http://blog.bennymichielsen.be/2009/01/04/using-fluent-nhibernate-in-spring-net/#comment-47</link>
		<dc:creator>Alexandre Bonte</dc:creator>
		<pubDate>Thu, 26 Aug 2010 14:15:28 +0000</pubDate>
		<guid isPermaLink="false">/post/2009/01/04/Using-Fluent-NHibernate-in-SpringNet.aspx#comment-47</guid>
		<description>Could not copy paste xml code... Sorry

Here the spring sample :

http://stackoverflow.com/questions/2049968/configuring-asp-net-mvc-2-with-spring-net-and-fluentnhibernate</description>
		<content:encoded><![CDATA[<p>Could not copy paste xml code&#8230; Sorry</p>
<p>Here the spring sample :</p>
<p><a href="http://stackoverflow.com/questions/2049968/configuring-asp-net-mvc-2-with-spring-net-and-fluentnhibernate" rel="nofollow">http://stackoverflow.com/questions/2049968/configuring-asp-net-mvc-2-with-spring-net-and-fluentnhibernate</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexandre Bonte</title>
		<link>http://blog.bennymichielsen.be/2009/01/04/using-fluent-nhibernate-in-spring-net/#comment-46</link>
		<dc:creator>Alexandre Bonte</dc:creator>
		<pubDate>Thu, 26 Aug 2010 14:13:01 +0000</pubDate>
		<guid isPermaLink="false">/post/2009/01/04/Using-Fluent-NHibernate-in-SpringNet.aspx#comment-46</guid>
		<description>[quote]
 
     
     
       
        Project.Core.NHibernate 
       
     
     
       
         
         
         
       
     
  
[/quote] </description>
		<content:encoded><![CDATA[<p>[quote]</p>
<p>        Project.Core.NHibernate </p>
<p>[/quote]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexandre Bonte</title>
		<link>http://blog.bennymichielsen.be/2009/01/04/using-fluent-nhibernate-in-spring-net/#comment-45</link>
		<dc:creator>Alexandre Bonte</dc:creator>
		<pubDate>Thu, 26 Aug 2010 14:08:42 +0000</pubDate>
		<guid isPermaLink="false">/post/2009/01/04/Using-Fluent-NHibernate-in-SpringNet.aspx#comment-45</guid>
		<description>Thanks Benny for this post ! and for people how want the spring configuration file :

   
     
     
       
        Project.Core.NHibernate 
       
     
     
       
         
         
         
       
     
  </description>
		<content:encoded><![CDATA[<p>Thanks Benny for this post ! and for people how want the spring configuration file :</p>
<p>        Project.Core.NHibernate</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: robsosno</title>
		<link>http://blog.bennymichielsen.be/2009/01/04/using-fluent-nhibernate-in-spring-net/#comment-44</link>
		<dc:creator>robsosno</dc:creator>
		<pubDate>Thu, 04 Mar 2010 20:03:01 +0000</pubDate>
		<guid isPermaLink="false">/post/2009/01/04/Using-Fluent-NHibernate-in-SpringNet.aspx#comment-44</guid>
		<description>After further testing I&#039;ve found that original Benny code almost works. The main change I&#039;ve made is related to loading assemblies (changed API):
[quote]
    public class TestNhibernateLocalSessionFactoryObject
        : LocalSessionFactoryObject
    {
        private string[] fluentNhibernateMappingAssemblies;
        /// &lt;summary&gt;
        /// Sets the assemblies to load that contain fluent nhibernate mappings.
        /// &lt;/summary&gt;
        /// &lt;value&gt;The mapping assemblies.&lt;/value&gt;
        public string[] FluentNhibernateMappingAssemblies
        {
            get { return fluentNhibernateMappingAssemblies; }
            set { fluentNhibernateMappingAssemblies = value; }
        }

        /// &lt;summary&gt;
        /// Fluent configuration.
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;config&quot;&gt;&lt;/param&gt;
        protected override void PostProcessConfiguration(Configuration config)
        {
            base.PostProcessConfiguration(config);

            Fluently.Configure(config)
               .Mappings(m =&gt;
               {
                   foreach (string assemblyName in fluentNhibernateMappingAssemblies)
                   {
                       m.HbmMappings
                            .AddFromAssembly(Assembly.Load(assemblyName));

                       m.FluentMappings
                            .AddFromAssembly(Assembly.Load(assemblyName));
                   }
               })
               .BuildConfiguration();
        }
    }
[/quote]
It just works for me. I&#039;ve used FNH build 1.0.0.623.</description>
		<content:encoded><![CDATA[<p>After further testing I&#8217;ve found that original Benny code almost works. The main change I&#8217;ve made is related to loading assemblies (changed API):<br />
[quote]<br />
    public class TestNhibernateLocalSessionFactoryObject<br />
        : LocalSessionFactoryObject<br />
    {<br />
        private string[] fluentNhibernateMappingAssemblies;<br />
        ///<br />
<summary>
        /// Sets the assemblies to load that contain fluent nhibernate mappings.<br />
        /// </summary>
<p>        /// <value>The mapping assemblies.</value><br />
        public string[] FluentNhibernateMappingAssemblies<br />
        {<br />
            get { return fluentNhibernateMappingAssemblies; }<br />
            set { fluentNhibernateMappingAssemblies = value; }<br />
        }</p>
<p>        ///<br />
<summary>
        /// Fluent configuration.<br />
        /// </summary>
<p>        ///
<param name="config"></param>
        protected override void PostProcessConfiguration(Configuration config)<br />
        {<br />
            base.PostProcessConfiguration(config);</p>
<p>            Fluently.Configure(config)<br />
               .Mappings(m =><br />
               {<br />
                   foreach (string assemblyName in fluentNhibernateMappingAssemblies)<br />
                   {<br />
                       m.HbmMappings<br />
                            .AddFromAssembly(Assembly.Load(assemblyName));</p>
<p>                       m.FluentMappings<br />
                            .AddFromAssembly(Assembly.Load(assemblyName));<br />
                   }<br />
               })<br />
               .BuildConfiguration();<br />
        }<br />
    }<br />
[/quote]<br />
It just works for me. I&#8217;ve used FNH build 1.0.0.623.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lemonhan</title>
		<link>http://blog.bennymichielsen.be/2009/01/04/using-fluent-nhibernate-in-spring-net/#comment-43</link>
		<dc:creator>lemonhan</dc:creator>
		<pubDate>Sun, 07 Feb 2010 02:25:39 +0000</pubDate>
		<guid isPermaLink="false">/post/2009/01/04/Using-Fluent-NHibernate-in-SpringNet.aspx#comment-43</guid>
		<description>Could you add a configuration within the spring xml file
in your blog?

</description>
		<content:encoded><![CDATA[<p>Could you add a configuration within the spring xml file<br />
in your blog?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: robsosno</title>
		<link>http://blog.bennymichielsen.be/2009/01/04/using-fluent-nhibernate-in-spring-net/#comment-42</link>
		<dc:creator>robsosno</dc:creator>
		<pubDate>Wed, 20 Jan 2010 09:45:22 +0000</pubDate>
		<guid isPermaLink="false">/post/2009/01/04/Using-Fluent-NHibernate-in-SpringNet.aspx#comment-42</guid>
		<description>After several trials and experiments I&#039;ve got slightly improved version: assemblies and properties comes (like show_sql) from Spring context.
The only hardcoded part remains Database section.
[quote]
    public class TestNhibernateLocalSessionFactoryObject
        : LocalSessionFactoryObject
    {
        private string[] fluentNhibernateMappingAssemblies;
        /// &lt;summary&gt;
        /// Sets the assemblies to load that contain fluent nhibernate mappings.
        /// &lt;/summary&gt;
        /// &lt;value&gt;The mapping assemblies.&lt;/value&gt;
        public string[] FluentNhibernateMappingAssemblies
        {
            get { return fluentNhibernateMappingAssemblies; }
            set { fluentNhibernateMappingAssemblies = value; }
        }

        /// &lt;summary&gt;
        /// Fluent configuration.
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;config&quot;&gt;&lt;/param&gt;
        protected override void PostProcessConfiguration(Configuration config)
        {
            IDictionary&lt;string, string&gt; properties;

            base.PostProcessConfiguration(config);

            properties = config.Properties;

            Fluently.Configure(config)
               .Database(
                   SQLiteConfiguration
                   .Standard
                   .ProxyFactoryFactory(properties[&quot;proxyfactory.factory_class&quot;])
                   .InMemory
               )
               .Mappings(m =&gt;
               {
                   foreach (string assemblyName in fluentNhibernateMappingAssemblies)
                   {
                       m.HbmMappings
                            .AddFromAssembly(Assembly.Load(assemblyName));

                       m.FluentMappings
                            .AddFromAssembly(Assembly.Load(assemblyName));
                   }

                   //.ExportTo(@&quot;c:ala&quot;);
               })
               .ExposeConfiguration(x =&gt;
               {
                   foreach (var item in x.Properties)
                   {
                       if (properties.ContainsKey(item.Key))
                       {
                           properties[item.Key] = item.Value;
                       }
                       else
                       {
                           properties.Add(item);
                       }
                   }
                   x.SetProperties(properties);
               })
               .BuildConfiguration();
        }
    }
[/quote]
I don&#039;t know why but foreach assemblyName works with field but not with a property.
Also in my case I have both fluent and xml mappings in the same assembly. If this doesn&#039;t work in other cases then you need to define two separate properties.</description>
		<content:encoded><![CDATA[<p>After several trials and experiments I&#8217;ve got slightly improved version: assemblies and properties comes (like show_sql) from Spring context.<br />
The only hardcoded part remains Database section.<br />
[quote]<br />
    public class TestNhibernateLocalSessionFactoryObject<br />
        : LocalSessionFactoryObject<br />
    {<br />
        private string[] fluentNhibernateMappingAssemblies;<br />
        ///<br />
<summary>
        /// Sets the assemblies to load that contain fluent nhibernate mappings.<br />
        /// </summary>
<p>        /// <value>The mapping assemblies.</value><br />
        public string[] FluentNhibernateMappingAssemblies<br />
        {<br />
            get { return fluentNhibernateMappingAssemblies; }<br />
            set { fluentNhibernateMappingAssemblies = value; }<br />
        }</p>
<p>        ///<br />
<summary>
        /// Fluent configuration.<br />
        /// </summary>
<p>        ///
<param name="config"></param>
        protected override void PostProcessConfiguration(Configuration config)<br />
        {<br />
            IDictionary<string , string> properties;</p>
<p>            base.PostProcessConfiguration(config);</p>
<p>            properties = config.Properties;</p>
<p>            Fluently.Configure(config)<br />
               .Database(<br />
                   SQLiteConfiguration<br />
                   .Standard<br />
                   .ProxyFactoryFactory(properties["proxyfactory.factory_class"])<br />
                   .InMemory<br />
               )<br />
               .Mappings(m =><br />
               {<br />
                   foreach (string assemblyName in fluentNhibernateMappingAssemblies)<br />
                   {<br />
                       m.HbmMappings<br />
                            .AddFromAssembly(Assembly.Load(assemblyName));</p>
<p>                       m.FluentMappings<br />
                            .AddFromAssembly(Assembly.Load(assemblyName));<br />
                   }</p>
<p>                   //.ExportTo(@&#8221;c:ala&#8221;);<br />
               })<br />
               .ExposeConfiguration(x =><br />
               {<br />
                   foreach (var item in x.Properties)<br />
                   {<br />
                       if (properties.ContainsKey(item.Key))<br />
                       {<br />
                           properties[item.Key] = item.Value;<br />
                       }<br />
                       else<br />
                       {<br />
                           properties.Add(item);<br />
                       }<br />
                   }<br />
                   x.SetProperties(properties);<br />
               })<br />
               .BuildConfiguration();<br />
        }<br />
    }<br />
[/quote]<br />
I don&#8217;t know why but foreach assemblyName works with field but not with a property.<br />
Also in my case I have both fluent and xml mappings in the same assembly. If this doesn&#8217;t work in other cases then you need to define two separate properties.</string></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rodrigo Longo</title>
		<link>http://blog.bennymichielsen.be/2009/01/04/using-fluent-nhibernate-in-spring-net/#comment-41</link>
		<dc:creator>Rodrigo Longo</dc:creator>
		<pubDate>Fri, 14 Aug 2009 20:03:42 +0000</pubDate>
		<guid isPermaLink="false">/post/2009/01/04/Using-Fluent-NHibernate-in-SpringNet.aspx#comment-41</guid>
		<description>I&#039;m working with HibernateDaoSupport and I can&#039;t figure out how to configure Fluent in order to make it work. Anybody could help me?</description>
		<content:encoded><![CDATA[<p>I&#8217;m working with HibernateDaoSupport and I can&#8217;t figure out how to configure Fluent in order to make it work. Anybody could help me?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

