Contributions I have made to the fluent-nhibernate API

In this post, I would like to outline the contribution I made to the fluent-nhibernate API open source project.  One of the features of the API is a fluent interface for creating the nhibernate configuration file for the ISessionFactory.  The ISessionFactory provides a few optional configuration properties.  An example of one these properties is  max_fetch_depth.

The max_fetch_depth property sets a maximum "depth" for the outer join fetch tree for single-ended associations (one-to-one, many-to-one).  A 0 disables default outer join fetching. 

After reviewing the way some of the other properties had already been set up.  I started with creating my first unit test to include this property.  Below is the unit test I created.

 

   1:  [Test]
   2:          public void Max_Fetch_Depth_should_set_property_value()
   3:          {
   4:              _config.MaxFetchDepth(2);
   5:              ValueOf("max_fetch_depth").ShouldEqual("2");
   6:          }

Then I implemented the following code for MaxFetchDepth.

   1:  public THIS MaxFetchDepth(int maxFetchDepth)
   2:          {
   3:              _values.Store(MaxFetchDepthKey, maxFetchDepth.ToString());
   4:              return (THIS)this;
   5:          }
 
This contribution was really easy to code, since I already had some other examples.  I was able to include all of the optional configuration properties with unit test.
 
Hopefully I will be able to add more contributions to the project.  As I do I will post to let everyone know.
 
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Related posts

Comments

August 26. 2008 09:42 AM

well done ! hope Fluent catches up with the just released NHibernate 2.0 GA

Amre Ellafi

October 2. 2008 10:32 AM

Awesome, I got to watch part of this session but had to leave, family duties. So, I am glad to see it online so I can watch the rest of it.

Jay Smith

October 2. 2008 10:33 AM

Oops, posted comment to wrong post.

Jay Smith

Add comment


 

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

January 6. 2009 03:41 PM

About Me

I'm a technologist living in Springdale, AR. My passion is learning and using technology from around the world.

Blog Twitter Flickr del.icio.us
TwitterCounter for @zachariahyoung

Flickr

Recent comments