<?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>Sun, 05 Sep 2010 19:42:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: admin</title>
		<link>http://blog.bennymichielsen.be/2009/01/04/using-fluent-nhibernate-in-spring-net/comment-page-1/#comment-5131</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-5131</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-page-1/#comment-5009</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-5009</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-page-1/#comment-5008</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-5008</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-page-1/#comment-5006</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-5006</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-page-1/#comment-421</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-421</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-page-1/#comment-420</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-420</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-page-1/#comment-418</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-418</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-page-1/#comment-417</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-417</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>
	<item>
		<title>By: liang</title>
		<link>http://blog.bennymichielsen.be/2009/01/04/using-fluent-nhibernate-in-spring-net/comment-page-1/#comment-416</link>
		<dc:creator>liang</dc:creator>
		<pubDate>Mon, 10 Aug 2009 14:27:29 +0000</pubDate>
		<guid isPermaLink="false">/post/2009/01/04/Using-Fluent-NHibernate-in-SpringNet.aspx#comment-416</guid>
		<description>protected override ISessionFactory NewSessionFactory(Configuration config)
        {
            config = Fluently.Configure(config)
                .Mappings(m =&gt; m.FluentMappings.AddFromAssemblyOf&lt;FluentSessionFactoryObject&gt;())
                .BuildConfiguration();
            return base.NewSessionFactory(config);
        }</description>
		<content:encoded><![CDATA[<p>protected override ISessionFactory NewSessionFactory(Configuration config)<br />
        {<br />
            config = Fluently.Configure(config)<br />
                .Mappings(m => m.FluentMappings.AddFromAssemblyOf<fluentsessionfactoryobject>())<br />
                .BuildConfiguration();<br />
            return base.NewSessionFactory(config);<br />
        }</fluentsessionfactoryobject></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Lieberman</title>
		<link>http://blog.bennymichielsen.be/2009/01/04/using-fluent-nhibernate-in-spring-net/comment-page-1/#comment-415</link>
		<dc:creator>David Lieberman</dc:creator>
		<pubDate>Mon, 13 Jul 2009 15:46:08 +0000</pubDate>
		<guid isPermaLink="false">/post/2009/01/04/Using-Fluent-NHibernate-in-SpringNet.aspx#comment-415</guid>
		<description>Thanks, Benny! I&#039;ll be interested to see what you come up with.</description>
		<content:encoded><![CDATA[<p>Thanks, Benny! I&#8217;ll be interested to see what you come up with.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
