Your first NHibernate based application

In a previous article I showed how to setup a developer machine to start using NHibernate as an ORM tool during the development of an application. I advocated a domain driven design (DDD) approach and a test driven development (TDD) style. This is the second article in a series of introductory chapters.

Define the Domain

Lets start by defining a very simple domain. For the moment it consists of one entity called Product. The product has 3 properties Name, Category and Discontinued.

image

Add a folder Domain to the FirstSample project of your solution. Add a new class Product.cs to this folder. The code is very simple and uses automatic properties (a feature of the new C# 3.0 compiler)

namespace FirstSolution.Domain
{
    public class Product
    {
        public string Name { get; set; }
        public string Category { get; set; }
        public bool Discontinued { get; set; }
    }
}

Now we want to be able to persist instances of this entity in a (relational) database. We have chosen NHibernate for this task. An instance of an entity in the domain corresponds to a row in a table in the database. So we have to define a mapping between the entity and the corresponding table in the database. This mapping can be done either by defining a mapping file (an xml-document) or by decorating the entity with attributes. I'll start with the mapping file.

Define the Mapping

Create a folder Mappings in the FirstSample project. Add a new xml-document to this folder and call it Person.hbm.xml. Please note the "hbm" part of the file name. This is a convention used by NHibernate to automatically recognize the file as a mapping file. Define "Embedded Resource" as Build Action for this xml file.

In the Windows Explorer locate the nhibernate-mapping.xsd in the src folder of NHibernate and copy it to your SharedLibs folder. We can now use this xml schema definition file when defining our mapping files. VS will then provide intellisense and validation when editing an xml mapping document.

Back in VS add the schema to the Product.hbm.xml file

image

Let's start now. Each mapping file has to define a <hibernate-mapping> root node

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" 
                   assembly="FirstSolution" 
                   namespace="FirstSolution.Domain">
 
  <!-- more mapping info here -->
  
</hibernate-mapping>

In a mapping file when referencing a domain class you always have to provide the fully qualified name of the class (e.g. FirstSample.Domain.Product, FirstSample). To make the xml less verbose you can define the assembly name (in which the domain classes are implemented and the namespace of the domain classes in the two attributes assembly and namespace of the root node. It's similar to the using statement in C#.

Now we have to first define a primary key for the product entity. Technically we could take the property Name of the product since this property must be defined and has to be unique. But it is common to use a surrogate key instead. For thus we add a property to our entity and call it Id. We use Guid as the type of the Id but it can as well be an int or a long.

using System;
 
namespace FirstSolution.Domain
{
    public class Product
    {
        public Guid Id { get; set; }
        public string Name { get; set; }
        public string Category { get; set; }
        public bool Discontinued { get; set; }
    }
}

The complete mapping file

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" 
                   assembly="FirstSolution" 
                   namespace="FirstSolution.Domain">
  
  <class name="Product">
    <id name="Id">
      <generator class="guid" />
    </id>
    <property name="Name" />
    <property name="Category" />
    <property name="Discontinued" />
  </class>
  
</hibernate-mapping>

NHibernate doesn't get in our way such as that it defines many reasonable defaults. So if you don't provide a column name for a property explicitly it will name the column according to the property. Or NHibernate can automatically infer the name of the table or the type of the column from the class definition. As a consequence my xml mapping file is not cluttered with redundant information. Please refer to the online documentation for more detailed explanation of the mapping. You can find it here.

Your solution explorer should look like this now (Domain.cd contains the class diagram of our simple domain)

image

Configure NHibernate

We now have to tell NHibernate which database product we want to use and provide it the connection details in form of a connection string. NHibernate supports many many database products!

Add a new xml file to the FirstSolution project and call it hibernate.cfg.xml. Set its property "Copy to Output" to "Copy always". Since we are using SQL Server Compact Edition in this first sample enter the following information into the xml file

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
  <session-factory>
    <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
    <property name="dialect">NHibernate.Dialect.MsSqlCeDialect</property>
    <property name="connection.driver_class">NHibernate.Driver.SqlServerCeDriver</property>
    <property name="connection.connection_string">Data Source=FirstSample.sdf</property>
    
    <property name="show_sql">true</property>
  </session-factory>
</hibernate-configuration>

With this configuration file we tell NHibernate that we want to use MS SQL Server Compact Edition as our target database and that the name of the database shall be FirstSample.sdf (=connection string). We have also defined that we want to see the SQL NHibernate generates and sends to the datbase (highly recommended for debugging purposes during development). Double check that you have no typos in the code!

Add an empty database called FirstSample.sdf to the FirstSample project (choose Local Database as template)

image

Click Add and ignore the DataSet creation wizard (just hit Cancel).

Test the Setup

It's now time to test our setup. First verify that you have the following files in your SharedLibs folder

image

The last 8 files you can find in the "Microsoft SQL Server Compact Edition" directory in your Programs folder.

image

Note: the System.Data.SqlServerCe.dll is located in the sub-folder Desktop.

All other files can be found in the NHibernate folder

Add a reference to the FirstSample project in your test project. Additionally add references to NHibernate.dll, nunit.framework.dll and Systm.Data.SqlServerCe.dll (remember to reference the files located in the SharedLibs folder!). Pay attention to set the property "Copy Local" to true for the assembly System.Data.SqlServerCe.dll since by default it is set to false!

Add a class called GenerateSchema_Fixture to your test project. Your test project should now look like this

image

We further need the 7 files sqce*.dll in the output directory. We can do this by using a post-build event in VS. Enter the following command in the "Post-build event command line"

copy $(ProjectDir)..\..\SharedLibs\sqlce*.dll $(ProjectDir)$(OutDir)

image

Now add the following code to the GenerateSchema_Fixture file

using FirstSolution.Domain;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
using NUnit.Framework;
 
namespace FirstSolution.Tests
{
    [TestFixture]
    public class GenerateSchema_Fixture
    {
        [Test]
        public void Can_generate_schema()
        {
            var cfg = new Configuration();
            cfg.Configure();
            cfg.AddAssembly(typeof (Product).Assembly);
            
            new SchemaExport(cfg).Execute(false, true, false, false);
        }
    }
}

The first line of the test method creates a new instance of the NHibernate configuration class. This class is used to configure NHibernate. In the second line we tell NHibernate to configure itself. NHibernate will look out for configuration information since we do not provide any information here in the test method. So NHibernate will search for a file called hibernate.cfg.xml in the output directory. That's exactly what we want since we have defined our settings in this file.

In the third line of the code we tell NHibernate that it can find mapping information in the assembly which contains also the class Product. At the time being it will only find one such file (Product.hbm.xml) as an embedded resource.

The fourth line of code uses the SchemaExport helper class of NHibernate to auto-"magically" generate the schema in the database for us.

Note: with this test method we do NOT want to find out whether NHibernate does its job correctly (you can be sure it does) but rater whether we have setup our system correctly.

If you have TestDriven.Net installed you can now just right click inside the test method and choose "Run Test(s)" to execute the test.

image

If every thing is ok you should see the following result in the output window

image

If you have ReSharper installed you can just start the test by clicking the yellow-green circle on the left border and choose Run.

image

The result is as follows

image

In case of Problems

If your test fails double check that you find the following files in your target directory (that is: m:dev\projects\FirstSolution\src\FirstSolution.Tests\bin\debug)

image

Double check also if you have no typos in the NHibernate configuration file (hibernate.cfg.xml) or in the mapping file (Product.hbm.xml). Finally check whether you have set the "Build Action" of the mapping file (Product.hbm.xml) to "Embedded Resource". Only continue if the test succeeds.

Our first CRUD operations

Now obviously our system is ready to start. We have successfully implemented our Domain, defined the mapping files and configured NHibernate. Finally we have used NHibernate to automatically generate the database schema from our Domain (and our mapping files).

In the spirit of DDD (see e.g. Domain Driven Design by Eric Evans) we define a repository for all crud operations (create, read, update and delete). The repository interface is part of the domain where as the implementation is not! The implementation is infrastructure specific. We want to keep our domain persistence ignorant (PI).

Add a new interface to the domain folder of our FirstSolution project. Call it IProductRepository. Let's define the following interface

using System;
using System.Collections.Generic;
 
namespace FirstSolution.Domain
{
    public interface IProductRepository
    {
        void Add(Product product);
        void Update(Product product);
        void Remove(Product product);
        Product GetById(Guid productId);
        Product GetByName(string name);
        ICollection<Product> GetByCategory(string category);
    }
}

Add a class ProductRepository_Fixture to the test project of the solution and add the following code

    [TestFixture]
    public class ProductRepository_Fixture
    {
        private ISessionFactory _sessionFactory;
        private Configuration _configuration;
 
        [TestFixtureSetUp]
        public void TestFixtureSetUp()
        {
            _configuration = new Configuration();
            _configuration.Configure();
            _configuration.AddAssembly(typeof (Product).Assembly);
            _sessionFactory = _configuration.BuildSessionFactory();
        }
    }

 

In the fourth line of the method TestFixtureSetUp we create a session factory. This is an expensive process and should thus be executed only once. That's the reason why I put it into this method which is only executed once during a test cicle.

To keep our test methods side effect free we re-create our database schema before the execution of each test method. Thus we add the following method

        [SetUp]
        public void SetupContext()
        {
            new SchemaExport(_configuration).Execute(false, true, false, false);
        }

 

And now we can implement the test method to add a new product instance to the database. Start by adding a new folder called Repositories to your FirstSolution project. Add a class ProductRepository to this folder. Make the ProductRepository inherit from the interface IProductRepository.
using System;
using System.Collections.Generic;
using FirstSolution.Domain;
 
namespace FirstSolution.Repositories
{
    public class ProductRepository : IProductRepository
    {
        public void Add(Product product)
        {
            throw new NotImplementedException();
        }
 
        public void Update(Product product)
        {
            throw new NotImplementedException();
        }
 
        public void Remove(Product product)
        {
            throw new NotImplementedException();
        }
 
        public Product GetById(Guid productId)
        {
            throw new NotImplementedException();
        }
 
        public Product GetByName(string name)
        {
            throw new NotImplementedException();
        }
 
        public ICollection<Product> GetByCategory(string category)
        {
            throw new NotImplementedException();
        }
    }
}

Manipulating Data

Now go back to the ProductRepository_Fixture test class and implement the first test method

        [Test]
        public void Can_add_new_product()
        {
            var product = new Product {Name = "Apple", Category = "Fruits"};
            IProductRepository repository = new ProductRepository();
            repository.Add(product);
        }

The first run of the test method will fail since we have not yet implemented the Add method in the repository class. Let's do it. But wait, we have to define a little helper class first which provides us session objects on demand.

using FirstSolution.Domain;
using NHibernate;
using NHibernate.Cfg;
 
namespace FirstSolution.Repositories
{
    public class NHibernateHelper
    {
        private static ISessionFactory _sessionFactory;
 
        private static ISessionFactory SessionFactory
        {
            get
            {
                if(_sessionFactory == null)
                {
                    var configuration = new Configuration();
                    configuration.Configure();
                    configuration.AddAssembly(typeof(Product).Assembly);
                    _sessionFactory = configuration.BuildSessionFactory();
                }
                return _sessionFactory;
            }
        }
 
        public static ISession OpenSession()
        {
            return SessionFactory.OpenSession();
        }
    }
}

This class creates a session factory only the first time a client needs a new session.

Now we can define the Add method in the ProductRepository as follows

        public void Add(Product product)
        {
            using (ISession session = NHibernateHelper.OpenSession())
                using (ITransaction transaction = session.BeginTransaction())
                {
                    session.Save(product);
                    transaction.Commit();
                }
        }

The second run of the test method will again fail with the following message

image

That's because NHibernate is by default configured to use lazy load for all entities. That is the recommended approach and I warmly recommend not to change it for a maximum of flexibility.

How can we solve this issue? It's easy we have to just make all our properties (and methods) of the domain object(s) virtual. Let's do this for our Product class

    public class Product
    {
        public virtual Guid Id { get; set; }
        public virtual string Name { get; set; }
        public virtual string Category { get; set; }
        public virtual bool Discontinued { get; set; }
    }

Now run the test again. It should succeed and we get the following output

image

Note the sql spit out by NHibernate.

Now we think that we have successfully inserted a new product into the database. But let's test it whether it is really so. Let's extend our test method

        [Test]
        public void Can_add_new_product()
        {
            var product = new Product {Name = "Apple", Category = "Fruits"};
            IProductRepository repository = new ProductRepository();
            repository.Add(product);
 
            // use session to try to load the product
            using(ISession session = _sessionFactory.OpenSession())
            {
                var fromDb = session.Get<Product>(product.Id);
                // Test that the product was successfully inserted
                Assert.IsNotNull(fromDb);
                Assert.AreNotSame(product, fromDb);
                Assert.AreEqual(product.Name, fromDb.Name);
                Assert.AreEqual(product.Category, fromDb.Category);
            }
        }

Run the test again. Hopefully it will succeed...

Now we are ready to implement also the other methods of the repository. For testing this we would rather have a repository (that is database table) already containing some products. Nothing easier than this. Just add a method CreateInitialData to the test class as follows

        private readonly Product[] _products = new[]
                 {
                     new Product {Name = "Melon", Category = "Fruits"},
                     new Product {Name = "Pear", Category = "Fruits"},
                     new Product {Name = "Milk", Category = "Beverages"},
                     new Product {Name = "Coca Cola", Category = "Beverages"},
                     new Product {Name = "Pepsi Cola", Category = "Beverages"},
                 };
 
        private void CreateInitialData()
        {
            
            using(ISession session = _sessionFactory.OpenSession())
                using(ITransaction transaction = session.BeginTransaction())
                {
                    foreach (var product in _products)
                        session.Save(product);
                    transaction.Commit();
                }
        }

Call this method from the SetupContext method (after the create schema call) and we are done. Now each time after the database schema is created the database is populated with some products.

Let's test the Update method of the repository with the following code

        [Test]
        public void Can_update_existing_product()
        {
            var product = _products[0];
            product.Name = "Yellow Pear";
            IProductRepository repository = new ProductRepository();
            repository.Update(product);
 
            // use session to try to load the product
            using (ISession session = _sessionFactory.OpenSession())
            {
                var fromDb = session.Get<Product>(product.Id);
                Assert.AreEqual(product.Name, fromDb.Name);
            }
        }

When running for the first time this code will fail since the Update method has not yet been implemented in the repository. Note: This is the expected behavior since in TDD the first time you run a test it should always fail!

Analogous to the Add method we implement the Update method of the repository. The only difference is that we call the update method of the NHibernate session object instead of the save method.

        public void Update(Product product)
        {
            using (ISession session = NHibernateHelper.OpenSession())
            using (ITransaction transaction = session.BeginTransaction())
            {
                session.Update(product);
                transaction.Commit();
            }
        }

Run the test again an watch it succeed.

image

The delete method is straight forward. When testing whether the record has really been deleted we just assert that the value returned by the session's get method is equal to null. Here is the test method

        [Test]
        public void Can_remove_existing_product()
        {
            var product = _products[0];
            IProductRepository repository = new ProductRepository();
            repository.Remove(product);
 
            using (ISession session = _sessionFactory.OpenSession())
            {
                var fromDb = session.Get<Product>(product.Id);
                Assert.IsNull(fromDb);
            }
        }

and here the implementation of the Remove method in the repository

        public void Remove(Product product)
        {
            using (ISession session = NHibernateHelper.OpenSession())
                using (ITransaction transaction = session.BeginTransaction())
                {
                    session.Delete(product);
                    transaction.Commit();
                }
        }

Querying the Database

We still have to implement the three methods which query the database for objects. Let's start with the most easy one, the GetById. First we write the test

        [Test]
        public void Can_get_existing_product_by_id()
        {
            IProductRepository repository = new ProductRepository();
            var fromDb = repository.GetById(_products[1].Id);
            Assert.IsNotNull(fromDb);
            Assert.AreNotSame(_products[1], fromDb);
            Assert.AreEqual(_products[1].Name, fromDb.Name);
        }

and then the code to fulfill the test

        public Product GetById(Guid productId)
        {
            using (ISession session = NHibernateHelper.OpenSession())
                return session.Get<Product>(productId);
        }

Now that was easy. For the following two methods we use a new method of the session object. Let's start with the GetByName method. As usual we write the test first

        [Test]
        public void Can_get_existing_product_by_name()
        {
            IProductRepository repository = new ProductRepository();
            var fromDb = repository.GetByName(_products[1].Name);
 
            Assert.IsNotNull(fromDb);
            Assert.AreNotSame(_products[1], fromDb);
            Assert.AreEqual(_products[1].Id, fromDb.Id);
        }

The implementation of the GetByName method can be done by using two different approaches. The first is using HQL (Hibernate Query Language) and the second one HCQ (Hibernate Criteria Query). Let's start with HQL. HQL is a object oriented query language similar (but not equal to) SQL.

        public Product GetByName(string name)
        {
            using (ISession session = NHibernateHelper.OpenSession())
            {
                Product product = session
                    .CreateQuery("from Product p where p.Name=:name")
                    .SetString("name", name)
                    .UniqueResult<Product>();
                return product;
            }
        }

In the above sample I have introduced a commonly used technique when using NHibernate. It's called fluent interfaces. As a result the code is less verbose and easier to understand. You can see that a HQL query is a string which can have embedded (named) parameters. Parameters are prefixed by a ':'. NHibernate defines many helper methods (like SetString used in the example) to assign values of various types to those parameters. Finally by using UniqueResult I tell NHibernate that I expect only one record to return. If more than one record is returned by the HQL query then an exception is raised. To get more information about HQL please read the online documentation.

The second version uses a criteria query to search the requested product.

        public Product GetByName(string name)
        {
            using (ISession session = NHibernateHelper.OpenSession())
            {
                Product product = session
                    .CreateCriteria(typeof(Product))
                    .Add(Restrictions.Eq("Name", name))
                    .UniqueResult<Product>();
                return product;
            }
        }

Many users of NHibernate think that this approach is more object oriented. On the other hand a complex query written with criteria syntax can quickly become difficult to understand.

The last method to implement is GetByCategory. This method returns a list of products. The test can be implemented as follows

        [Test]
        public void Can_get_existing_products_by_category()
        {
            IProductRepository repository = new ProductRepository();
            var fromDb = repository.GetByCategory("Fruits");
 
            Assert.AreEqual(2, fromDb.Count);
            Assert.IsTrue(IsInCollection(_products[0], fromDb));
            Assert.IsTrue(IsInCollection(_products[1], fromDb));
        }
 
        private bool IsInCollection(Product product, ICollection<Product> fromDb)
        {
            foreach (var item in fromDb)
                if (product.Id == item.Id)
                    return true;
            return false;
        }

and the method itself might contain the following code

        public ICollection<Product> GetByCategory(string category)
        {
            using (ISession session = NHibernateHelper.OpenSession())
            {
                var products = session
                    .CreateCriteria(typeof(Product))
                    .Add(Restrictions.Eq("Category", category))
                    .List<Product>();
                return products;
            }
        }

Summary

In this article I have shown you how to implement a basic sample domain, define the mapping to a database and how to configure NHibernate to be able to persist domain objects in the database. I have shown you how to typically write and test CRUD methods for your domain objects. I have taken MS SQL Compact Edition as sample database but any other supported database can be used (you only have to change the hibernate.cfg.xml file accordingly). Ee have no dependencies on external frameworks or tools other than the database and NHibernate itself (.NET of course never counts here).

Print | posted on Tuesday, April 01, 2008 12:29 AM

Comments on this post

# re: Your first NHibernate based application

Requesting Gravatar...
Who is the author of this piece? Very comprehensive, well done.
Left by Matt on Apr 01, 2008 1:51 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Matt: Thanks for your nice comment. I'm the author of this article
Left by Gabriel Schenker on Apr 01, 2008 5:27 PM

# re: Your first NHibernate based application

Requesting Gravatar...
well founded, very good explained, helpful examples, a veritable treasure trove, in which one can learn so much. Keep up that good work!
Left by Peter on Apr 02, 2008 7:44 PM

# re: Your first NHibernate based application

Requesting Gravatar...
great introduction to NHibernate, it helped me a lot (Im a NH newbie :)
Left by Libor on Apr 04, 2008 3:49 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Very good work, Gabriel!

But as a domain should be PI I would suggest that you define the mappingfiles in its own external library. I have started using NHibernate for the first time, and it was no a hard job to get it to work. It takes only one second to define the mappinghandling in the cfg.xml file.

Benny
Left by Benny on Apr 04, 2008 8:13 PM

# re: Your first NHibernate based application

Requesting Gravatar...
@Benny: you are correct. For a proper separation of concerns (SoC) one can put the mapping files (as well as the implementation of the repositories) in a separate library (Project). But I wanted to keep the complexity of the sample as low as possible. And there has also been a lively discussion in the ALT.NET group about having many or as few as possible projects per solution...
Left by Gabriel Schenker on Apr 05, 2008 2:05 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Gabriel, thanks for this article. It's a great introduction to NHibernate that's really helped me see and I've really enjoyed working through it. Superb all round!

Thanks, Sean
Left by Sean Kearon on Apr 05, 2008 4:46 AM

# re: Your first NHibernate based application

Requesting Gravatar...
@Gabriel:I only heard the correct, that was enough for me :). I agree that the complexity gets lowered by having fewer projects. But it's kind of misleading when you say that you want to do thing in the heart of DDD and not doing that crusial thing about DDD. But your post was so good that I'll let that past.

Keep up the good work.
Left by Benny on Apr 05, 2008 7:45 AM

# re: Your first NHibernate based application

Requesting Gravatar...
@Sean: It's a pleasure for me to help other people! I also profited a lot from other blogs.

@Benny: rest assured that in future posts where I'll write on advanced topics I'll be stricter in following the patterns and best practices.
Left by Gabriel Schenker on Apr 05, 2008 8:31 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Gabriel, you are awesome. Thanks for making this so crystal clear! Please, please, please keep posting more on TDD, NHibernate, DDD, and more...
Left by Peter on May 12, 2008 3:18 PM

# re: Your first NHibernate based application

Requesting Gravatar...
This is a great start to using NHibernate and to familiarizing ourselves with the latest way of development. This is about my first touch with NHibernate technology, but really not the last one!

Danke schön Gabriel!
Left by Will on Jun 02, 2008 7:08 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Fantastic hands-on introduction to nHibernate. A good article to get started, keep up the good work.
Left by Kannan on Jul 01, 2008 1:40 AM

# re: Your first NHibernate based application

Requesting Gravatar...
hey this is some great stuff!
Left by james on Jul 04, 2008 12:09 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Great article. Can you continue to write a followup article explaining how to persist when inheritance comes into play?
Thanks in advance!
Left by tobsen on Jul 04, 2008 10:45 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Good job. Exciting article. I followed along... except that I used VS.NET 2005, VB.NET, and mySQL.
Left by Kris Krause on Jul 11, 2008 9:18 AM

# re: Your first NHibernate based application

Requesting Gravatar...
I found that beside setting "Embedded Resource" as "Build Action" for the mapping and configuration file I also had to set the property "Copy to output directory" to "Copy always"
Left by Ronald on Jul 18, 2008 12:37 AM

# re: Your first NHibernate based application

Requesting Gravatar...
@Ronald: you ONLY have to set "Copy to output directory" to "Copy always" for the configuration file but NOT for the mapping files since the latter will be embedded in the binary and thus NOT needed as stand-alone files in the bin directory!
Left by Gabriel Schenker on Jul 20, 2008 6:12 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Very comprehensive, great illustrations, simple but practical...and light on the philosophical insight of coding practices.

Thanks for putting this together.

Well done!
Left by BB on Jul 21, 2008 5:50 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Can you explain why a transaction is always required when calling Session.Save(entity)?

Great series of articles. Thanks! :)
Left by Eric on Jul 23, 2008 5:37 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Very good article. But I have a questions. I don't want to use xml file. Is it possible? Annotations?
Left by Honovan on Jul 25, 2008 1:04 AM

# re: Your first NHibernate based application

Requesting Gravatar...
@Honovan: yes there are at least two
a) use Castle Active Record (annotate the entities with Attributes) or
b) use an internal DSL as described by Jeremy D. Miller in his blog (http://codebetter.com/blogs/jeremy.miller/archive/2008/06/18/working-faster-and-fewer-mapping-errors-with-nhibernate.aspx)
Left by Gabriel Schenker on Jul 27, 2008 3:47 AM

# re: Your first NHibernate based application

Requesting Gravatar...
@Eric: a transaction is needed because NHibernate only caches any changes internally when calling save and does NOT "auto-magically" save it to the database. Only when committing a transaction are all pending changes flushed to the database. (For further details see also the articles about the Unit of Work pattern in this blog)
Left by Gabriel Schenker on Jul 27, 2008 3:51 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Hi!
Do you have to hand craft the mapping file? Is there anyway to generate this. ???
Left by fuzze on Jul 28, 2008 11:56 AM

# re: Your first NHibernate based application

Requesting Gravatar...
@fuzze: yes I always prefer to hand-craft the mappings. I don't like generated code too much. But there are tools to automatically generate the hbm files. Easiest solution (if you don't mind to "pollute" your domain entities with mapping attributes) is certainly "Castle Active Record" or "NHibernate Attributes"
Left by Gabriel Schenker on Jul 28, 2008 5:33 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Thanx for the reply.. any links at hand for me to check out? I prefer keeping my entities simple although I'm timestrapped at the moment:-)
Left by fuzze on Jul 28, 2008 7:45 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Thanks for the reply. I´m java programmer, and I'm starting in .net framework.
Left by Honovan on Jul 29, 2008 1:19 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Hello,

sorry for bugging in, but, could you please provide me the code for the project you worked here on? i am a new and young C#+NHibernate developer, and it would greately help me. of course if, you still have it...

thanks.
Left by Bogdan on Aug 02, 2008 7:12 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Hello,

It's me again. I have managed quite well so far in learning NHibernate, but I have a slight problem I would like to ask you about.
I'll try to explain it here.

I have followed your example, step-by-step. Everything went well until I tried to populate my database with different products, and then test the Add method. So, the test for Add method went well for adding only one product, but when I call CreateInitialData(), I get this error:
=================================
TestCase 'WorkingOnNH_Test.ProductRepository_Fixture.AddTest'
failed: NHibernate.Exceptions.GenericADOException : could not insert: [WorkingOnNH.Domain.Product][SQL: INSERT INTO PRODUCTS (Name, Category, OnSale, ID) VALUES (?, ?, ?, ?)]
----> System.Data.OracleClient.OracleException : ORA-00001: unique constraint (BOGDAN.SYS_C004335) violated.
=================================
Indeed I use Oracle10g2XE, and not SQL, but I have managed to pass the FixtureSetupTest, and the single AddTest. I've started debugging, and I noticed the error is thrown at this line

======================
transaction.Commit();
======================

from CreateInitialData() method, that is identically with yours.

I am clueless, so please excuse me for posting this here. If can offer me another possibility to get in contact with you, I would apreciate it.
Left by Bogdan on Aug 04, 2008 1:46 AM

# re: Your first NHibernate based application

Requesting Gravatar...
@Bogdan: you can find the source code here:
http://hibernatingrhinos.googlecode.com/svn/trunk/FirstSolution/

Unfortunately the oracle community of NHibernate seems to be rather "inactive" and as a consequence there are some problems found here and there. I regret, I do not have an oracle db and thus cannot verify the behavior you mention. The cause of the exception might be the primary key of type Guid (Oracle does not support it). For possible solutions please check the NHUsers mail group (there have been some threads about this very topic)
Left by Gabriel Schenker on Aug 04, 2008 5:15 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Gabriel Schenker: thank you so much for the blog and I'm a NH newbie the source code directory you provided it requires to downoad one file at a time, is there a way you can zip all the solution in file?
thanks again for great work and i hope to see more on NH

-Nisar
Left by Nisar Khan on Aug 05, 2008 5:48 AM

# re: Your first NHibernate based application

Requesting Gravatar...
thank you, it really helps
Left by Dian Pitaloka on Aug 05, 2008 10:48 PM

# re: Your first NHibernate based application

Requesting Gravatar...
@Nisar: you don't have to download it manually. Just install a SVN client tool like TortoiseSVN and point it to the URL. The tool will download the whole solution...
Left by Gabriel Schenker on Aug 07, 2008 5:03 PM

# re: Your first NHibernate based application

Requesting Gravatar...
This is really a great tutorial. Quite comprehensive and elaborate.
Left by Khalil Muhammad on Aug 13, 2008 10:09 PM

# re: Your first NHibernate based application

Requesting Gravatar...
This is the great article I have ever read on NHibernating. You brought every best tools TDD, NHibernating, NAnt..etc..together with marvelous related links. Pls keep going ... and like to learn more from you on other best practices on coding...but how can I ???
Left by Hasan on Aug 22, 2008 2:58 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Great article, I am just trying to do my first app, and I am getting the following:

A project with an Output Type of Class Library cannot started directly.

The VS then recommends if I want to debug to add an executable project to this solution.

Is this what I have to do?, I expected the "FirstSolution.Test" could be debugged... what I am doing wrong?



Left by Olga on Aug 26, 2008 3:50 AM

# re: Your first NHibernate based application

Requesting Gravatar...
@Olga: A test project cannot be run like a console or winform application since it is a DLL. You need a Test-Runner application to do so. YOu have several possibilities. You have to either run the test project with the Unit-Test runner of Resharper (if you have installed it - highly recommended) or with Testdriven.net (there is a free and a commercial version).
Another possible solution is to use the test runner of NUnit (please read e.g. the documentation at www.nunit.org about how to do this)
Left by Gabriel Schenker on Aug 26, 2008 8:53 AM

# re: Your first NHibernate based application

Requesting Gravatar...
gr8, code.

It was actually my first NHibernate based application (walkthrough)
Left by pbarve on Aug 28, 2008 1:01 AM

# re: Your first NHibernate based application

Requesting Gravatar...
I've seen a couple of "introductions to NHibernate" but this is really great piece of work.

Beats all others by a mile :-).

And, if I may suggest something - .NET developers work with various editions of SQL Server (SQL Server Express probably being the most common), so I think it'd be helpful (especially to "newbies") for the article if you could somehow note the differences for various SQL Server database (I suppose all you need to change is connection string).

Once again, great work!
Left by Zvonimir Vanjak on Aug 28, 2008 1:41 AM

# Bugfixes for Post

Requesting Gravatar...
don't know whether there is a fix for this two "bugs":

1. there is a typo in the description for creating the Product.hbm.xml. (it's refered to as Person.hbm.xml)

2. the postbuild will only work in situations where no spaces are in the path. so brace your command with "" like:
copy "$(ProjectDir)..\..\SharedLibs\sqlce*.dll" "$(ProjectDir)$(OutDir)"
Left by Rainer Schuster on Sep 06, 2008 7:28 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Great job, well done!

This is more than 'just' a introduction to NHibernate, it is also a an introduction to good software engineering tools.
Left by Günter Lissner on Sep 18, 2008 4:45 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Nice article--I've got a couple of questions that I hope you can help me with:

1) The sqlce*.dll files don't copy (in VS 2008) without the post-build action, even if I set their build action to 'Content' and set 'Copy to Output Directory' property to 'Copy always'. Is there a simple explanation for why that is?

2) I include the post-build action in the main project, but when I compile, I get an error message saying the command "exited with Code 1". I can't find documentation on the error. Any idea what might by going on?

Thanks for your help.
Left by David Veeneman on Sep 26, 2008 11:13 AM

# re: Your first NHibernate based application

Requesting Gravatar...
I've got the post-build command working--the 'Code 1' error meant there was a syntax error in the command. My project file structure was slightly different than yours. Once I fixed that and added double quotes around the two copy parameters, it worked fine.

But I've still got my original question about using the post-build event: I know it doesn't work to simply set the "Copy to Output Directory" property for these files to "Copy Always", but I don't understand why. Any thoughts? Thanks for your help.
Left by David Veeneman on Sep 26, 2008 2:33 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Cheers, just followed this to get me up-and-running very quickly.
Left by James on Sep 30, 2008 1:00 PM

# re: Your first NHibernate based application

Requesting Gravatar...
@David: I regret but I don't know why it doesn't work as you suggest. But never mind, we have a work-around with the post build event
Left by nhibernate on Oct 02, 2008 7:38 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Easiest and most through article without doing a complete dump of information. Thank You!
Left by Junaid on Oct 05, 2008 3:58 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Excellent article. You should write a book in this style. Very easy to follow and from nothing to a working CRUD framework in no time at all. (I don't see any NHibernate books out currently) Thanks!
Left by Jamie on Oct 13, 2008 11:24 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Thank you for the great article. One thing I did not understand is how two entities of different type can be commited in one transaction. The CRUD-Operations of your entities all have their own transactions. Am I thinking too much in SQL?
Left by Aris on Oct 15, 2008 9:02 PM

# re: Your first NHibernate based application

Requesting Gravatar...
@Aris: you have to use the Unit of Work pattern. I have published a series about this pattern in this blog :-) or in the wiki of the nhforge site (www.nhforge.org)
Left by nhibernate on Oct 19, 2008 5:14 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Absolutely great article.
Very informative and great to follow!

Good to see C#3 stuff in use too, makes it easier to follow.
Left by Daniel Hoelbling on Oct 19, 2008 9:44 PM

# re: Your first NHibernate based application

Requesting Gravatar...

This took me several hours to setup namely because I was trying to mesh a whole slew of hibernate resources from the web with this. This is actually a fantastic tutorial that stands on its own two feet. More depth could be added into the mapping file(s), but for what it does, it does quite well.

If you want to learn how to setup an NHibernate project and learn how to do Test Driven development with NUnit, this is the best place I've found to start. Just take a breath and be patient. You'll get there.
Left by jbaisden on Oct 21, 2008 4:48 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Wow. Thanks for your help. I found your article on the UoW Pattern and implemented it. Now another beginners question: Can I use one UnitOfWork for a complete (Windows Forms) application, or is it better to keep the UoW small?
Left by Aris on Oct 24, 2008 4:05 AM

# re: Your first NHibernate based application

Requesting Gravatar...
I tried this method of configuration and was unable to successfully create the driver for CE. When I changed the line:
" NHibernate.Driver.SqlServerCeDriver"
to:

"NHibernate.Driver.SqlClientDriver"

it at least stopped throwing exceptions. Now, I haven't completed the lab yet, so perhaps in the long run it won't work, but that's what it took to at least get it to not throw.
Left by Brandon on Oct 24, 2008 4:50 AM

# re: Your first NHibernate based application

Requesting Gravatar...
@Aris: I would start an UoW when opening/refreshing a form and end the UoW when saving/leaving the form.
But be aware that in a WinForms (or WPF) application you can potentially have several concurrent UoW...
Left by nhibernate on Oct 27, 2008 6:12 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Thanks again for your help. I read in another posting of yours that you are thinking about implementig a concurrency enabled UoW. I'm looking forward to see how you solve this problem. How could I support you?
Left by Aris on Nov 05, 2008 2:18 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Good job. Very comprehensive and to the point.
Left by Deven on Nov 10, 2008 4:47 AM

# re: Your first NHibernate based application

Requesting Gravatar...
If you are using MS Test (rather than NUnit), add hibernate.cfg.xml to the list of deployed files in LocalTestRun.testrunconfig. Otherwise, MS Test will not be able to find it.
Left by David Veeneman on Nov 11, 2008 1:15 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Amazing post to get started, easy to follow step by step.

I experienced a little problem at the first CRUD application. To get to the error on virtual properties, I had to configure the property proxyfactory.factory_class (NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle suggested by the exception thrown) and include the binary NHibernate.ByteCode.Castle.dll (or ...LinFu.dll).

Did I miss something? I'm using NHibernate 2.0.1.
Left by Eivind on Nov 11, 2008 5:35 AM

# re: Your first NHibernate based application

Requesting Gravatar...
@Eivind: Obviously You are using the trunk of NHibernate (version 2.1). There is a breaking change is so far that the hard coded dependency of NH to Castle DynamicProxy2 has been given up an replaced by an implementation that gives us the freedom to choose our proxy generator (at the time being LinFu or Castle).
My post has been written before this happened!
Left by nhibernate on Nov 15, 2008 11:21 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Great! Thanks a lot!
Left by Joh on Nov 18, 2008 12:38 AM

# re: Your first NHibernate based application

Requesting Gravatar...
first i want to thank you for this post, its great.

im having a problem with the

copy $(ProjectDir)..\..\SharedLibs\sqlce*.dll $(ProjectDir)$(OutDir)

i get that the directory dont exist and this
copy C:\Users\Konnekt\Desktop\Domy\Domy.Test\..\..\SharedLibs\sqlce*.dll C:\Users\Konnekt\Desktop\Domy\Domy.Test\bin\Debug\" exited with code 1.

i have try to google but cant find a awnser to my problem. what can i do to fix it?
Left by Zoran on Nov 18, 2008 9:30 AM

# re: Your first NHibernate based application

Requesting Gravatar...
nevermind i just wanted it to work. i copy the files manually instead.
Left by Zoran on Nov 18, 2008 10:16 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Thank you very much for this exelent Guide through the firsts steps of using NHibernate.

I'd like especially the test first approach.

Can you refere to some good tutorials using Spring with NHibernate? Thats my next quest to compete ;)


greetz

menty

Left by menty on Nov 19, 2008 6:40 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Great tutorial but...

I also have a problem with the proxy and I don't understand how to fix it.

Could you please help me?
Which Libraries do I have to include und what di I have to write in the cfg.xml?

thanks
Telefisch
Left by Telefisch on Nov 20, 2008 12:11 AM

# re: Your first NHibernate based application

Requesting Gravatar...
something else...
I had the same Problems with the copy statement and fixed it with some "

So my copy-statement looks like this:
copy "$(ProjectDir)..\..\SharedLibs\sqlce*.dll" "$(ProjectDir)$(OutDir)"

perhaps its only a VS2008 problem...
Left by Telefisch on Nov 20, 2008 12:13 AM

# re: Your first NHibernate based application

Requesting Gravatar...
...proxy-problem fixed!
thanks.
Left by Telefisch on Nov 20, 2008 12:50 AM

# re: Your first NHibernate based application

Requesting Gravatar...
I have a few more question using UoWs in Windows Forms applications. Perhaps you can give me some advice.
To avoid concurrent UoWs, my first approach was to use a UoW for each user action. A great disadvantage of this approach is, that caching and lazy loading don't work anymore as soon as the UoW has ended.
So I began to think about the possibility of supporting concurrent UoWs, as you suggested before. The only solution that came into my mind was to save the Session/UoW as member variable in the form and passing it as argument to every repository object beeing used. I don't like this idea very much. Do you know of a better solution and could you give me a hint?

Do you know if sessions are garbage collected or do they have to be closed/disposed explicitly when closing the form?
Left by Aris on Nov 22, 2008 7:48 AM

# re: Your first NHibernate based application

Requesting Gravatar...
At a certain moment you say:

"The last 8 files you can find in the "Microsoft SQL Server Compact Edition" directory in your Programs folder."

But I don't want to use the compact edition. As far as i know i am using the "normal edition". What files should i reference to?
Left by Marco on Dec 02, 2008 3:40 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Nice tutorial, much better than the others about, however i still have a few issues to iron out.

1. I am using Microsoft Sql Server 2005, can anyone point me in the direction to find out what .dll's need to go where to get that working ? I looked in the folder of MS Sql and found a good 20-30 dll files, cant need all of them surely.

2. Product class does NOT like that the get; set; parts are left blank. I added some variables to the class and filled the accessor methods with those but it seemed to be a large thing to leave out.

3. By default, VS 2005 seems to think that the output type of the projectS are "Class Library" it complains about this saying that outputs of that type cannot be started directly and i should link them to a project with a valid .exe. I changed the output type to "Windows Application" and then "Console Application", both of which reply with:

"FirstSolution\obj\Debug\FirstSolution.exe' does not contain a static 'Main' method suitable for an entry point

OR

FirstSolution\src\FirstSolution\bin\Debug\
FirstSolution.exe' could not be found

PLEASE, if anyone knows what is going on id be VERY appreciative as i have been trying to get nHibernate to work for weeks now with no sucess and the idea of ORM is very interesting to me.

Thank you for your time.
Left by David on Dec 02, 2008 4:30 AM

# re: Your first NHibernate based application

Requesting Gravatar...
@David: sorry for the long delay.
1) you don't have to reference any extra dll's when accessing any version of SQL Server (except the compact edition). The Sql Server driver is part of the "System.Data" dll which is part of the .NET framework.

2) I am using automatic properties. This is a feature of C# 3.0 which is available with VS 2008. So if you are still using VS 2005 you have to explicitely implement the properties (using e.g. a backing field)

3) Normally I don't present full featured applications in my post. The code I present is intended to be part of an application. The code as it is can only be run in a (unit-) test runner (e.g. the test runner of Resharper or NUnit)
Left by Gabriel N. Schenker on Dec 07, 2008 6:30 PM

# re: Your first NHibernate based application

Requesting Gravatar...
@Marco: if you use the SQL server standard edition you can just delete the "post build event command line" which I have defined in the post. You don't have to reference any extra dll since the sql server driver is part of the .NET framework (System.Data.dll).
Left by Gabriel N. Schenker on Dec 07, 2008 6:34 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Ok, thank you for the info.

I have read alot about ORM and it seems to be a really good way of setting up a database against a website. Maybe thats just because me and SQL have never been the best of friends.

Gabriel N. Schenker - "Normally I don't present full featured applications in my post. The code I present is intended to be part of an application. The code as it is can only be run in a (unit-) test runner (e.g. the test runner of Resharper or NUnit)"

Ah ok, i have not looked into any unit testing software as of yet as i have not managed to get a project using nHibernate to even compile yet. Figured i will learn to crawl before i walk.

Thank you for your time on this matter and if any of you guys know of any resources that may help an abolsute beginner get of the ground in terms of unit testing, nHibernate i would be most grateful.

Once again, thank you.
Left by David on Dec 07, 2008 11:21 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Nice Post! But I still have the same problem that Elvind...I already configured the property proxyfactory.factory_class but it didn't work, i have the following error:
"TestFixture failed: NHibernate.Bytecode.UnableToLoadProxyFactoryFactoryException : Unable to load type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle' during configuration of proxy factory class."
Help!!
Left by Bren on Dec 18, 2008 2:12 PM

# Your first NHibernate based application

Requesting Gravatar...
@Bren: you are using the trunk. It is a new requirement of the trunk to add the following statement to the config file

<property name='proxyfactory.factory_class'>NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>

that is, you have to explicitly define which proxy factory you want to use.


Please also have a look at this post:
nhforge.org/.../nh2-1-0-bytecode-providers.aspx
Left by Gabriel N. Schenker on Dec 22, 2008 7:52 PM

# re: Your first NHibernate based application

Requesting Gravatar...
The Update test will not pass. I have checked and it appears that I have everything as the tutorial has it. The problem seems to be that I am trying to update a product with a guid of "00000-0000 ..." How can you stop Nunit from destroying the database to investigate?
Left by Nick on Dec 24, 2008 7:14 AM

# re: Your first NHibernate based application

Requesting Gravatar...
dooood this is that 3rd article ive been through and i got nada. a working example in the least possible lines of code is by far preferable to spending hours before being to compile and finding again that it dont work. It looks like a great product. pitty the doco is frankly sh1te
Left by ananon on Dec 24, 2008 5:13 PM

# re: Your first NHibernate based application

Requesting Gravatar...
@Nick: I do not fully understand your problem/question. A single unit test does NOT destroy the database. So just run the unit test that does not work and then you can examine the db.
Left by nhibernate on Jan 08, 2009 1:56 AM

# re: Your first NHibernate based application

Requesting Gravatar...
@aanon: can you be more precise about what you are talking, please...
Left by nhibernate on Jan 08, 2009 2:02 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Thanks for this nice tutorial.

I don't quite understand how sessions and transactions are used in NHibernate. Each method in ProductRepository seems to create and use its own session+transaction. And then, the CreateInitialData seems to call the Repository.Save method in a loop within a new session+transaction context. How is the unit of work defined here?

Any help would be appreciated, thanks in advance.
Left by mg on Jan 16, 2009 8:43 AM

# re: Your first NHibernate based application

Requesting Gravatar...
@mg: in a real application one would probably use the Unit of Work pattern. The UoW would then be started by the application service layer.
See my posts about the UoW pattern in this blog.
Left by Gabriel N. Schenker on Jan 21, 2009 1:35 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Nicely done,
Just the right amount of detail.
Very cleanly written article.
Thanks.
Left by Radu W. on Jan 30, 2009 6:06 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Great works, Thanks.
It seems that session is not closed
Left by Hoare.WOo on Feb 01, 2009 1:19 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Hi there - have built a test project in vb.net in vs 2008 using your examples and can't get past the following error.

The project is called MediaLoader. It does not seem to load the hbm.xml file with the mapping. The namespace is definetaly correct, and I am at a loss. Your help would be appreciated

Steve

TestCase 'Dev.MediaRepository_Fixture.can_add_new_product'
failed: System.TypeLoadException : Could not load type 'Dev.MediaLoader.Domain.MediaUpload' from assembly 'MediaLoader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
at Dev.MediaRepository_Fixture.can_add_new_product()
Left by Steve on Mar 01, 2009 11:55 PM

# re: Your first NHibernate based application

Requesting Gravatar...
I can't thank you enough cos' I've searching for a week to learn this and your article made it in a twinkling of an eye.

So I followed this and everything went along just fine.

I wanted to add an extra class (class user). So:

- In FirstSolution.Domain, I added : IUserInterface.cs and User.cs

- In FirstSolution.Mapping, I added: User.hbm.xml

- In FirstSolution.Repositories, I added UserRepository.cs

- In FirstSolution.Repositories.NHibernateHelper.cs, I added also this line:
configuration.AddAssembly(typeof(User).Assembly);


When I run the test, I face the following error:
***** FirstSolution.Tests.GenerateSchema_Fixture.Can_generate_schema
16:04:43,671 ERROR [TestRunnerThread] Configuration [(null)]- Could not compile the mapping document: FirstSolution.Mappings.Product.hbm.xml
NHibernate.MappingException: Could not compile the mapping document: FirstSolution.Mappings.Product.hbm.xml ---> NHibernate.DuplicateMappingException: Duplicate class/entity mapping FirstSolution.Domain.Product

at NHibernate.Cfg.Mappings.AddClass(PersistentClass persistentClass)

Would you help please, I started using your sample to develop some code.
Left by Great!! One question... on Mar 13, 2009 11:35 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Hi again, I posted the "GreAt!! one question" post.

Just to say I also tried to put all new code (user related) in the same files (correponding product files). and I have the same error.

I'll keep on trying cos I have no other choice, this tutorial is the best I ever found.

Thx
Left by Gaby on Mar 16, 2009 7:49 AM

# Nicely Done

Requesting Gravatar...
This article REALLY helped me out.. Very well written and just the right mix of details versus "seeing it work".

Thanks a lot Gabriel, I really appreciate you taking the time out to write this article.
Left by Rob Cooper on Mar 23, 2009 11:32 AM

# re: Your first NHibernate based application

Requesting Gravatar...
@Great...: the exception clearly states that there is a duplicate entry in the mapping files. Obviously you have some copy past error in the xml. please double check your hbm's
Left by Gabriel N. Schenker on Apr 05, 2009 11:52 AM

# re: Your first NHibernate based application

Requesting Gravatar...
This article is fantastic. Really helpful.
Thank you very much !
Left by Alex Jarnoux on Apr 10, 2009 1:45 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Thank you for this excellent tutorial. I found it extremely helpful to get going with nHibernate and TDD. Thanks again, Mark
Left by Mark Levinson on May 05, 2009 10:57 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Good article ;-)

Gabriel Schenker, have you got an article about connecting to MySQL? I have some problems with it but didn't found working samples.
Left by Chiz on May 08, 2009 2:56 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Hi! Great article, but I can't get it working...

Though I have the same code as you, but I get the following error:
'FirstSolution.Domain.Product.Id.get' must declare a body because it is not marked abstract of extern.
I have the same code as you have in Product.cs, am I missing something?
Left by AVARD on May 08, 2009 3:33 AM

# re: Your first NHibernate based application

Requesting Gravatar...
This tutorial so far is great. I am using the built in VS2008 Test project type instead of NUnit and for the life of me I can't the test project to load the SqlServerCE assembly:

Test method FirstSolution.Tests.GenerateSchema_Fixture.Can_generate_schema threw exception: NHibernate.HibernateException: Could not create the driver from NHibernate.Driver.SqlServerCeDriver. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> NHibernate.HibernateException: The IDbCommand and IDbConnection implementation in the assembly System.Data.SqlServerCe could not be found. Ensure that the assembly System.Data.SqlServerCe is located in the application directory or in the Global Assembly Cache. If the assembly is in the GAC, use element in the application configuration file to specify the full name of the assembly..

My assembly is referenced and copy local = true. It is also in the run dir of test results and the bin\debug dir of the test project...help!
Left by Daryl Hemeon on May 11, 2009 3:29 PM

# re: Your first NHibernate based application

Requesting Gravatar...
I redid the all tests using NUnit and I am receiving the same result as above:

----> System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
----> NHibernate.HibernateException : The IDbCommand and IDbConnection implementation in the assembly System.Data.SqlServerCe could not be found. Ensure that the assembly System.Data.SqlServerCe is located in the application directory or in the Global Assembly Cache. If the assembly is in the GAC, use element in the application configuration file to specify the full name of the assembly.
Left by Daryl Hemeon on May 12, 2009 9:45 AM

# re: Your first NHibernate based application

Requesting Gravatar...
I had the wrong install of the SqlServer Compact Framework...apparently...
Left by Daryl Hemeon on May 12, 2009 10:10 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Hi first of all thanks for the nice tutorial but i'm stucked...

I get the next error and dont know how to fix it :(
NHibernate.Bytecode.UnableToLoadProxyFactoryFactoryException: Unable to load type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle' during configuration of proxy factory class.
Possible causes are:
- The NHibernate.Bytecode provider assembly was not deployed.
- The typeName used to initialize the 'proxyfactory.factory_class' property of the session-factory section is not well formed.


Plz help me out? More information plz how does this come ?
Left by Joris on May 19, 2009 7:20 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Hi,
I am using Vs 2008 and my hibernate.cfg.xml is as follows




NHibernate.Driver.SqlClientDriver
NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle

"Data Source=xxx;Initial Catalog=xxx;Integrated
Security=SSPI;"

10
false
NHibernate.Dialect.MsSql2000Dialect
true
60
true 1, false 0, yes 'Y', no 'N'




when I run the app I keep on getting the following error and don't know how to solve it

NHibernate.Bytecode.UnableToLoadProxyFactoryFactoryException: Unable to load type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle' during configuration of proxy factory class.
Possible causes are:
- The NHibernate.Bytecode provider assembly was not deployed.
- The typeName used to initialize the 'proxyfactory.factory_class' property of the session-factory section is not well formed.
can you pls pls help me
Left by Venkatesh on May 22, 2009 4:38 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Thank you very much for a most excellent tutorial. Everything works with NHibernate 2.01 and MsSql Server 2005 (also thanks to comments left here from other users).

I have tried NHibernate several times but this is the first time with total success.

Thanks again.
Left by Stig Benning on May 27, 2009 5:37 AM

# re: Your first NHibernate based application

Requesting Gravatar...
As a domain should be PI I would suggest that you define the mappingfiles in its own external library. I have started using NHibernate for the first time, and it was no a hard job to get it to work. It takes only one second to define the mappinghandling in the cfg.xml file.
Left by club penguin on Jun 02, 2009 7:26 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Thanks for this amazing tutorial,

I get the following error run the Add test:
UKIL.Client.NHibernate2Ce.Tests.ProductRepository_Fixture (TestFixtureSetUp):
System.TypeInitializationException : The type initializer for 'NHibernate.Proxy.CastleProxyFactory' threw an exception.
----> System.IO.FileNotFoundException : Could not load file or assembly 'Castle.DynamicProxy, Version=1.1.5.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' or one of its dependencies. The system cannot find the file specified.

Am I missing something?

I followed the tutorial step by step, seems that I have all the files required.
Left by Ilan on Jun 03, 2009 4:59 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Using NH2.1 Alpha3

Like others said in the new version of NHibernate some updates:
Choose factory (castle,linfu, or spring) and deploy it:
For example, copy NHibernate.ByteCode.Castle.dll in SharedLibs (so it's deployed with post build - see above)
Configure the factory according to the factory provider in the hibernate config, like the following:
NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle
read this <nhforge.org/.../nh2-1-0-bytecode-providers.aspx>

Another update is the use of ExportSchema(cfg).Execute(...) which has new parameters,
I changed it to
ExportSchema(cfg).Create(true/*bool script*/,true /*bool export*/)
Now I have the Add test working ...
Left by Ilan on Jun 03, 2009 6:07 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Great tutorial!
Works with a bit of tweaking using VS2008Team and MySql 5.1.30_community. (no nUnit, using VS2k8 for tests)

Really appreciate the time and effort you put into this Gabriel Schenker.

Steve
Left by steveB on Jun 12, 2009 4:53 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Thanks for the very useful article. I have referenced your article here : haditeo.wordpress.com/.../nhibernate-schemaexport/
Left by Hadi Teo. on Jun 12, 2009 7:04 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Fantastic article! Can't wait to get up and running with Nhibernate in my own apps.
Left by DanB on Jun 17, 2009 11:27 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Great article, thank you.
Left by Kuppu Sammy on Jun 27, 2009 9:29 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Thanks for the tutorial, and the feedback to my previous question. All is well now and i have it up and running... for the most part.

However, my system disagrees with the lines;

[code]
var products = session
.CreateCriteria(typeof(Product))
.Add(Restrictions.Eq("Category", category))
.List();
return products;
[/code]

Namely, it cannot find "Restrictions". More-over, the link you provide to further HQL documentation does not mention "Restriction" at all. Nor do any of my google searches show anything involving HQL and the word 'Restrictions'.

What i did find in the documentation however was the "Expression", located in the 'NHibernate.Expression' namespace. As a result i have changed the line of code to;

.Add(Expression.eq("ParentCatagoryID", "ID"))

as i only want values from the db returned where the 'PK_id' column is identical to the 'ParentCatagoryID' (I.E the catagory is not a sub-catagory of another)

So far my tests build fine. But i am notoriously bad at writing solid tests and so i ask you this.

Have a made a noob-mistake with the Restrictions keyword and missed a using statement somewhere or has Restrictions been depreciated since you wrote this ? Can i expect identical behaviour from using Expressions.eq as when using Restrictions.eq ?

Thank you for your time.


Left by David on Jul 03, 2009 9:11 AM

# re: Your first NHibernate based application

Requesting Gravatar...
I have a problem with ISession the error is "The type or namespace name "SessionFactory" could not be found. Did I miss an refernce?
Left by Ms. Kim on Jul 06, 2009 5:53 AM

# re: Your first NHibernate based application

Requesting Gravatar...
This took me a long time to figure out, and I decided to just create the tests in the FirstSolution directory , it worked better for me , and just have one project.

Just want to say I finally got it working and I went through all the issues that were posted previously and then some.

I , thanks to all the previous posts, got mine working.

Thank you for a great Tutorial, I enjoyed doing this, learned alot about NHibernate.

Left by Mendy on Jul 08, 2009 8:49 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Brilliant post, I'm a NH newbie but this makes you feel that it isn't a mountain to climb!

Cheers
Pete
Left by peteski on Jul 12, 2009 10:09 AM

# re: Your first NHibernate based application

Requesting Gravatar...
This is really very nice article. Keep it up

But i am getting exception when i run test Can_add_new_product Method from ProductRepository_Fixture class

[Test]
public void Can_add_new_product()
{
var product = new Product { Name = "Apple", Category = "Fruits" };
IProductRepository repository = new ProductRepository();
repository.Add(product);
}
the exception detail is
TestCase 'FirstSolution.Tests.ProductRepository_Fixture.Can_add_new_product'
failed: NHibernate.Bytecode.ProxyFactoryFactoryNotConfiguredException : The ProxyFactoryFactory was not configured.
Initialize 'proxyfactory.factory_class' property of the session-factory configuration section with one of the available NHibernate.ByteCode providers.
Example:
NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu
Example:
NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle
at NHibernate.Bytecode.AbstractBytecodeProvider.get_ProxyFactoryFactory()
at NHibernate.Cfg.Configuration.Validate()
at NHibernate.Cfg.Configuration.BuildSessionFactory()
C:\Dev\projects\FirstSolution\src\FirstSolution\Repositories\NHibernateHelper.cs(26,0): at FirstSolution.Repositories.NHibernateHelper.get_sessionFactory()
C:\Dev\projects\FirstSolution\src\FirstSolution\Repositories\NHibernateHelper.cs(34,0): at FirstSolution.Repositories.NHibernateHelper.OpenSession()
C:\Dev\projects\FirstSolution\src\FirstSolution\Repositories\ProductRepository.cs(16,0): at FirstSolution.Repositories.ProductRepository.Add(Product product)
C:\Dev\projects\FirstSolution\src\FirstSolution.Tests\ProductRepository_Fixture.cs(41,0): at FirstSolution.Tests.ProductRepository_Fixture.Can_add_new_product()


0 passed, 1 failed, 0 skipped, took 5.00 seconds (NUnit 2.5).
Left by Qaiser on Aug 06, 2009 5:31 PM

# re: Your first NHibernate based application

Requesting Gravatar...
above problem has been solved.

but now i have no overload function with four parameters of type

new SchemaExport(cfg).Execute(false, true, false, false);
Left by Qaiser on Aug 10, 2009 5:30 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Excellent piece of work! Thanks!
Left by Leo on Aug 19, 2009 9:16 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Please fix the print friendly version. I have two problems with it:

In civilized countries we use the DIN A4 paper size which means that text is lost on the right hand side.

I don't want idiotic comments like this one to appear on the printout of the excellent article by default, so a selectability on whether to include comments or not would be a nice feature.

Now I've wasted 39 pages of paper on my boss' ridiculously expensive-to-maintain printer and my job is on the line. Again.
Left by rikard on Sep 03, 2009 10:00 PM

# re: Your first NHibernate based application

Requesting Gravatar...
I'm getting a compile error on this:
new SchemaExport(cfg).Execute(false, true, false, false);
Saying no SchemaExport taking 4 args, any hint on how to correctly compile?
Left by TS on Sep 20, 2009 8:48 AM

# re: Your first NHibernate based application

Requesting Gravatar...
For whoever is having errors with the line I reported above, I believe it is because I was using NHibernate 3.0 instead of the 2.x the article is I guess using.
It is a matter of a few minor changes to get this working with 3.0,
particularly I had to add this line to the configuration file:
NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle
execute a different signature for teh SchemaExport(false, true, false)
and add some references dlls that were not mentioned but all are in the nhibernate build folder.
hope this helps someone.
Left by TS on Sep 20, 2009 10:46 AM

# re: Your first NHibernate based application

Requesting Gravatar...
When building this on a 64 bit machine, try setting the build to x86 instead of Any CPU, to get around the --BadImageFormatException error while testing. Yeah - that was 4 hours of my day.
Left by Jill Brady on Sep 30, 2009 8:52 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Fantastic article, we all need to start somewhere!
Left by river on Oct 10, 2009 8:52 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Good job. Thank you.
Left by ngân hàng on Oct 22, 2009 8:00 PM

# Düğün Davetiyesi

Requesting Gravatar...
güzel davetiye örnekleri,davetiye modelleri düğün davetiyeleri
Left by davetiye on Oct 28, 2009 11:26 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Thanks again for your help. I read in another posting of yours that you are thinking about implementig a concurrency enabled UoW. I'm looking forward to see how you solve this problem. How could I support you?
Left by auto insurance quotes on Nov 02, 2009 5:32 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Last 2 days I am trying to create an DB application using MS-Access and NHibernate. I found the following document in the net:
www.thoughtproject.com/.../NHibernateWithAccess/
In this document some NHibernate installer is mentioned. I have tried to search the installer is not available anywhere. Then I have tried to find the NHibernate.JetDriver.dll for handleing MS-Access DB. But, its also not available.

Now I am really lustrated about NHibernate. Can anybody help me on this issue?
Left by Tirtha on Nov 03, 2009 5:27 AM

# re: Your first NHibernate based application

Requesting Gravatar...
güzel davetiye örnekleri,davetiye modelleri düğün davetiyeleri
Left by homeschooling on Nov 05, 2009 9:37 PM

# re: Your first NHibernate based application

Requesting Gravatar...
MS-Access DB. But, its also not available.

Now I am really lustrated about NHibernate. Can anybody help me on this issue?
Left by Online High School on Nov 05, 2009 9:38 PM

# re: Your first NHibernate based application

Requesting Gravatar...
I have tried to search the installer is not available anywhere. Then I have tried to find the
Left by get diploma on Nov 05, 2009 9:38 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Now I am really lustrated about NHibernate. Can anybody help me on this issue?
Left by distance learning high school on Nov 05, 2009 9:40 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Can anybody help me on this issue?
Left by homeschool online on Nov 05, 2009 9:41 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Fuck u and your online homeschooling u cunt.
Left by jerked off online on Nov 07, 2009 8:01 PM

# re: Your first NHibernate based application

Requesting Gravatar...
I completely agree with the above comment, the internet is with a doubt growing into the most important medium of communication across the globe and its due to sites like this that ideas are spreading so quickly.
Left by casino gambling players on Nov 13, 2009 11:50 PM

# re: Your first NHibernate based application

Requesting Gravatar...
The identity field saves a database ID field in an object to maintain identity between an in-memory object and a database row." And
Left by Orkut Greetings on Nov 16, 2009 10:43 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Sir thank you very much for the masterpiece, I am about to reading the article.
Left by work at home opportunities on Nov 27, 2009 12:35 AM

# re: Your first NHibernate based application

Requesting Gravatar...
this is such a great app. You did a great job on this app. keep up the good work.
Left by church sound systems on Nov 29, 2009 7:08 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Hi thanks for this article.

I worked with it and i am using sql server ce 2008 sp1 and vs 2008 sp1.

i got sqlceExcepton was unhandled

There was an error parsing the query. [ Token line number = 1,Token line offset = 20,Token in error = Desc ]



System.Data.SqlServerCe.SqlCeException was unhandled
Message="There was an error parsing the query. [ Token line number = 1,Token line offset = 20,Token in error = Desc ]"
Source="SQL Server Compact ADO.NET Data Provider"
HResult=-2147217900
NativeError=25501
StackTrace:
at System.Data.SqlServerCe.SqlCeCommand.CompileQueryPlan()
at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
at NHibernate.AdoNet.AbstractBatcher.ExecuteNonQuery(IDbCommand cmd)
at NHibernate.AdoNet.NonBatchingBatcher.AddToBatch(IExpectation expectation)
at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object id, Object[] fields, Boolean[] notNull, Int32 j, SqlCommandInfo sql, Object obj, ISessionImplementor session)
at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object id, Object[] fields, Object obj, ISessionImplementor session)
at NHibernate.Action.EntityInsertAction.Execute()
at NHibernate.Engine.ActionQueue.Execute(IExecutable executable)
at NHibernate.Engine.ActionQueue.ExecuteActions(IList list)
at NHibernate.Engine.ActionQueue.ExecuteActions()
at NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session)
at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)
at NHibernate.Impl.SessionImpl.Flush()
at NHibernate.Transaction.AdoTransaction.Commit()
at FDCDAL.Repository.JobRepository.Add(Job job) in C:\FDC9\FDCDAL\FDCDAL\Repository\JobRepository.cs:line 20
at FDCDAL.Program.Main(String[] args) in C:\FDC9\FDCDAL\FDCDAL\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Left by Abdul on Nov 30, 2009 5:21 PM

# re: Your first NHibernate based application

Requesting Gravatar...
I'm not sure which two versions of SQL Server you're comparing?
Left by Direct Buy on Dec 01, 2009 5:29 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Thanks for this invaluable tutorial. I have to admit to have been struggling to get even a basic application up and running - but I think that this has gotten me out of the woods.
Left by Drum Kits on Dec 03, 2009 4:19 AM

# re: Your first NHibernate based application

Requesting Gravatar...
this tutorial is so simple and well-explained that even a beginner like myself can understand it. the formatting and screenshots are extremely helpful. thank you!
Left by baby shower invitations on Dec 03, 2009 9:45 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Good job, Thanks.
Left by Cherukuri Venkateswarlu on Dec 08, 2009 12:01 AM

# Restrictions

Requesting Gravatar...
This is response to the error regarding the "Restrictions" clause error mentioned by David:

[code]
var products = session
.CreateCriteria(typeof(Product))
.Add(Restrictions.Eq("Category", category))
.List();
return products;
[/code]

The "Restrictions" object can be found in the namespace "NHibernate.Criterion". Adding the following line at the top of your code will solve your issue:

[code]
using NHibernate.Criterion;
[/code]
Left by David Pizon on Dec 08, 2009 4:32 AM

# re: Your first NHibernate based application

Requesting Gravatar...
I think I will have to go back and read the first lesson to understand all of this better. Thank you for this valuable information.
Left by symptoms of cancer on Dec 08, 2009 4:53 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Great article. Really like the focus on testing.
Left by Matt on Dec 11, 2009 8:39 AM

# re: Your first NHibernate based application

Requesting Gravatar...
I agree, this post is very well done. Showing how to do and evaluate the tests is very helpful for the user.
Left by home improvement on Dec 11, 2009 4:50 PM

# re: Your first NHibernate based application

Requesting Gravatar...
If you’re playing with NH3, you might want to try the new Linq provider that’s in there. It’s still early days and certainly nothing like ready for production, but it does support considerably more function than the previous Linq provider. Take a look at NHibernate.Test.Linq for example usage.
Left by Gamblers palace review on Dec 11, 2009 11:05 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Thanks a lot from Germany.

This gives you the best introduction to the work with NHibernate i found in the net.
Left by vetja on Dec 16, 2009 4:20 AM

# re: Your first NHibernate based application

Requesting Gravatar...
As always your blog posts make your new changes really easy to work with. My project StructuredWeb that’s similar to Sh#rp architecture but IMO much easier to use and understand is about to be released so I’ll be adding more to the blogosphere about using FNH even if some of it is just rehashed in your earlier posts but I still think it will help people to see my mapping over the Northwind db since it’s moderately close to a real world application.
Left by paris hotell on Dec 16, 2009 5:09 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Thanks for sharing wonderful information with us.
Left by Silk Ties on Dec 16, 2009 8:34 PM

# Moscow hotels

Requesting Gravatar...
Thanks alot for this nice information .
Left by Moscow hotels on Dec 17, 2009 7:07 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Great article. It's been very helpful. I'm also taking a dive into NHibernate too.
Left by Shared Web Hosting on Dec 20, 2009 10:15 PM

# re: Your first NHibernate based application

Requesting Gravatar...
I would be interested in learning how many people use these templates.we implemented a tagging system, which so far is not being used very much. Perhaps we don’t explain it well, perhaps our functionality is lacking.
Left by www.astrologyjackpot.com/ on Dec 22, 2009 1:02 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Very well written article indeed, thank you so much for sharing such information with us, i hope we will see more from author in the future. Cheers.
Left by business card scanner on Dec 23, 2009 2:09 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Thanks for shared this with us.i found this informative and interesting blog so i think so its very useful and knowledge able.I would like to thank you for the efforts you have made in writing this article ..
Left by Paris Hotell on Dec 23, 2009 2:37 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Considerably, the article is in reality the greatest on this noteworthy topic. I agree with your conclusions and will eagerly look forward to your next updates. Saying thanks will not just be sufficient, for the wonderful clarity in your writing. I will acai berry immediately grab your rss feed to stay privy of any updates. Pleasant work and much success in your business dealings!
Left by weight loss pill on Dec 26, 2009 1:16 AM

# re: Your first NHibernate based application

Requesting Gravatar...
I must admit, great tips!
Left by Essay writing on Dec 30, 2009 8:00 AM

# re: Your first NHibernate based application

Requesting Gravatar...
First of all thanks a lot for the great and informative entry. I have to admit that I always find something useful in your website. Reading this post about the nhibernate based application I have noticed some new things for me which I have not known before. Well some details were a little bit difficult for me, because I am only a beginner in work with applications. Thanks a lot one more time for the great and useful entry and I will be waiting for other great posts from you in the nearest future.
Regards, Matt Steward
Left by mobile development on Jan 02, 2010 4:52 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Nice tutorial, much better than the others about, however i still have a few issues to iron out.
Left by Love Poems on Jan 04, 2010 4:57 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Thank you Gabriel, really dont have much too say just wanted to thank you for the great tutorials
Left by Como ganar mas dinero on Jan 08, 2010 12:19 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Very detailed post beautifully written and presented. If only all technical content was presented like this - I wouldn't be as inept as I am...
Left by Guitars on Jan 12, 2010 5:27 AM

# re: Your first NHibernate based application

Requesting Gravatar...
It is a matter of a few minor changes to get this working with 3.0,
particularly I had to add this line to the configuration file:
NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle
execute a different signature for teh SchemaExport(false, true, false)
and add some references dlls that were not mentioned but all are in the nhibernate build folder.
Left by free video song on Jan 15, 2010 6:03 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Thanks that you created the good story about this topic. Though, to select the distinguished custom essays service, I have to know something just about written essay.
Left by mGAmy on Jan 15, 2010 9:37 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Thanks for sharing this article.That's very helpful and interesting.
Left by Barbera del monferrato on Jan 17, 2010 10:59 PM

# Business Directory Canada

Requesting Gravatar...
Seriously great tips.I agree.Thanks for your informative article.
Left by Business Directory Canada on Jan 19, 2010 9:43 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Good indeed. I don't want to miss this opportunity. Thanks for such information.
Left by chopper tattoo on Jan 20, 2010 8:16 PM

# re: Your first NHibernate based application

Requesting Gravatar...
execute a different signature for teh SchemaExport(false, true, false)
and add some references dlls that were not mentioned but all are in the nhibernate build folder.
Left by nexium on Jan 21, 2010 1:01 AM

# re: Your first NHibernate based application

Requesting Gravatar...
I've seen a couple of "introductions to NHibernate" but this is really great piece of work.

Beats all others by a mile :-).

And, if I may suggest something - .NET developers work with various editions of SQL Server (SQL Server Express probably being the most common), so I think it'd be helpful (especially to "newbies") for the article if you could somehow note the differences for various SQL Server database (I suppose all you need to change is connection string).

Once again, great work!



Download free new movies
Left by Download free new movies on Jan 22, 2010 5:57 AM

# re: Your first NHibernate based application

Requesting Gravatar...
thanks a lot for the great posts, great information I think.
Left by teen upskirt on Jan 23, 2010 3:42 AM

# Leadership Styles

Requesting Gravatar...
Excellent work.All the best.Just amazing!!!!
Left by Leadership Styles on Jan 24, 2010 10:14 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Always amazing!!!!!
Left by build your own solar panel on Jan 26, 2010 5:02 PM

# re: Your first NHibernate based application

Requesting Gravatar...
I have noticed some new things for me that I did not know before. As well as some of the details were a little difficult for me because I am only a beginner in working with the applications. Sarah and the work of a lot of success in your business!
Left by adjustable beds on Jan 26, 2010 8:45 PM

# Your first NHibernate based application

Requesting Gravatar...
The exact directions stated worked well. I easily understood what the essay writer is trying to say. Plus the detailed info, this one is really helpful! I hope I can still find same useful articles in this blogsite!
Left by Homework Help on Jan 27, 2010 5:24 PM

# re: Your first NHibernate based application

Requesting Gravatar...
What a superb post to an HHibernate newbie.
Provillus | Resveratrol Supplements
Left by Resveratrol Supplements on Jan 30, 2010 5:32 AM

# re: Your first NHibernate based application

Left by fotografia ślubna Bielsko on Jan 31, 2010 8:52 AM

# re: Your first NHibernate based application

Requesting Gravatar...
how about I am forget my password? Can I keep open my system?
Left by homes for sale on Feb 01, 2010 3:01 PM

# Your first NHibernate based application

Requesting Gravatar...
I really enjoyed working through it.
Left by air conditioning repair tampa on Feb 02, 2010 5:56 PM

# re: Your first NHibernate based application

Requesting Gravatar...
There are several laws through Kate Moss's street shoot photos of three styles UGG Boots sale which is highly exposed. How Nice!! uk ugg boots are the Favorite of Grey bear UGG Boots ukwith pon-poms are right for clothings in grey color, being moderate without losing elegance. The Unknown Cons of
UGG Boots store . Here's the Answer. The black color Ugg is mostly worthy of collection which is never old fashioned. While collocating with black clothes, it sends out cool sense to unlimited degree.yes it is Look On Ball:
UGG Boots sale!
Left by igwg on Feb 02, 2010 6:15 PM

# re: Your first NHibernate based application

Left by 25th Wedding Anniversary on Feb 02, 2010 10:53 PM

# re: Your first NHibernate based application

Left by Property Management Services on Feb 03, 2010 5:31 PM

# re: Your first NHibernate based application

Requesting Gravatar...
NHIbernate based application tutorial that was awesome. It's is very complex to go through all these codes, but it is very interesting and informative. NHibernate is OR/M which helps us to reduce the gap between database and domain model. Thanks for sharing.

Valentine Competitions
Left by valentines hotel deals on Feb 04, 2010 5:26 PM

# re: Your first NHibernate based application

Requesting Gravatar...
v
Left by term life insurance on Feb 04, 2010 8:24 PM

# re: Your first NHibernate based application

Requesting Gravatar...
I’ve been most successful using your last suggestion. Nothing else has worked. I’m unable to “stack” these for some reason, so I’d love to figure that out, but thanks for the tips so far. research paper
Left by Ben on Feb 07, 2010 12:56 AM

# re: Your first NHibernate based application

Requesting Gravatar...
I like your site its very good. This post was very well done.
Left by full tilt rakeback on Feb 08, 2010 9:12 AM

# re: Your first NHibernate based application

Requesting Gravatar...
I must admit, great tips for users!
Left by Essay writing on Feb 09, 2010 8:13 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Hey my friend, thats a fantastic hands-on introduction to n Hibernate. It helps you a lot if you have just started! Keep up the good work!
Wordpress Themes
Left by Worpress Themes on Feb 10, 2010 9:21 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Woh! I consider its great information
Left by Property Management Services on Feb 10, 2010 8:49 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Thanks for such a great post and the review, I am totally impressed! Keep stuff like this

coming.
Left by kanchan on Feb 10, 2010 9:24 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Great stuff. I'm still baffled by NHibernate - but I'm so glad that there are some clever people around like the author of this article:
Looking for bad credit car finance or bad credit car loans? Maybe you need some gap insurance?
Left by Blueshound on Feb 10, 2010 10:46 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Nice sharing, I am delighted to find it. Thanks for sharing it here.
Left by Birthday SMS on Feb 13, 2010 12:44 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Thank You……………………………………………….


Free Web Directory | 1 | 1 |1 | 1 |1 |1 |1 |1 |1 |1 |1 |1 | 1 |1 |1 |1 | |SEO Blogs | Human Resources | SEO Architect | 1 | 1 | 1 | 1 | Indian SEO Company | 1 | 1 | 1 | Local Classified | Free Blogs | Watch Movie online | Oriya Matrimonials | Maharashtra Tourism | Goa Tourism
Left by jamea on Feb 14, 2010 9:14 PM

# re: Your first NHibernate based application

Requesting Gravatar...
wow thank you so much
Left by watches uk on Feb 14, 2010 10:14 PM

# louis vuitton handbag

Requesting Gravatar...
Thank you for the great web site - a true resource, and one many people clearly enjoy thanks for sharing the info, keep up the good work going....
coach handbag
Left by sam on Feb 14, 2010 11:41 PM

# re: Your first NHibernate based application

Requesting Gravatar...
I'm sold you have just explained many areas that I've been struggling grasp and put together. This is the best article i've read thank you so much. Off to read more of your gold! Nice work v-much appreciated.
Left by Nathan on Feb 15, 2010 11:58 PM

# re: Your first NHibernate based application

Requesting Gravatar...
First off, I love this web site. Great reviews and it’s helped me find a lot more of what I like. I have a variety of topics including information on Rival crock pot replacement parts and crock pot lids
Left by Ranch hand bumpers on Feb 16, 2010 1:21 AM

# re: Your first NHibernate based application

Requesting Gravatar...
wowza. a ton of stuff found here. Looks like I'll need some C# programming and maybe some open-e dss storage to help my WOW Private Servers for WoW.
Left by video game news on Feb 16, 2010 9:49 AM

# re: Your first NHibernate based application

Requesting Gravatar...
I have read alot about ORM and it seems to be a really good way of setting up a database against a website. Maybe thats just because me and SQL have never been the best of friends.

-----------
ez saver
Left by vijaysbhagat on Feb 16, 2010 7:15 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Very nice and helpful information has been given in this article. I must say that this is a great post. I loved reading it. You have done a great job.
Left by Dolce Gabbana Sunglasses on Feb 16, 2010 8:45 PM

# re: Your first NHibernate based application

Requesting Gravatar...
In the third line of the code It tells that it can find mapping information in the assembly which contains also the class Product. At the time being it will only find one such file (Product.hbm.xml) as an embedded resource.

------------
easy saver program
Left by vijaysbhagat on Feb 17, 2010 2:53 AM

# re: Your first NHibernate based application

Requesting Gravatar...
fantastic article! I'll try to implement these tips for sure
Left by custom essays on Feb 17, 2010 3:24 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Please update this article, when properly update to reflect the Castle/LinFu proxy problem you will have a great piece... otherwise it will be useless.

For readers having an issue with the Castle/LinFu proxy problem, you must also include a reference to either Nhibernate.ByteCode.Castle or Nhibernate.ByteCode.LinFu in your bin folder and update the nhibernate.cfg.xml file with the additional entry: NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle

Thanks.
Left by Jerry on Feb 17, 2010 3:38 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Its always cool to come along a site like yours that has this type of topics to read about. Thoroughly enjoyed and will definitely be returning often
Left by Movers Manhattan on Feb 17, 2010 7:26 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Awesome! Some really helpful information in there. Bookmarked. Excellent source.
Left by scheduling software on Feb 17, 2010 8:51 PM

# re: Your first NHibernate based application

Requesting Gravatar...
NHIbernate based application tutorial that was awesome. It's is very complex to go through all these codes, but it is very interesting and informative. NHibernate is OR/M which helps us to reduce the gap between database and domain model. Thanks for sharing.
free recipes online | food health questions
Left by health questions on Feb 19, 2010 9:46 PM

# re: Your first NHibernate based application

Requesting Gravatar...
The tutorial was absolutely great, codes and other information are described very perfectly...Amazing Sharing....

Toronto rentals | استضافة | Guru Gita

Left by Toronto Apartments For Rent on Feb 19, 2010 11:04 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Hello admin, I must admit that today is my first time I visit here. However, I have found so many interesting thing in your blog and I really love that.
Left by Laser Hair Removal New York City on Feb 19, 2010 11:17 PM

# re: Your first NHibernate based application

Requesting Gravatar...


Lida Zayiflama Kapsulu Daha Ayintili Bilgi
Left by Lida on Feb 21, 2010 12:53 AM

# re: Your first NHibernate based application

Requesting Gravatar...

Cheap Car Insurance Quotes


Compare whole life insurance quotes including car insurance, whole life insurance and term life insurance.
cheap auto insurance. Get cheapest car insurance rates comparisons. Compare insurance quotes offering best car insurance, whole life insurance, term life insurance, auto insurance comparison.
Offers coverage for auto, whole life insurance, term life insurance and more.
Left by Wilson on Feb 21, 2010 4:08 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Hi,
You have posted a good informative notes. I do not know much, but somewhere I read that, NHibernate is an Object-relational mapping (ORM) solution for the Microsoft .NET platform: it provides a framework for mapping an object-oriented domain model to a traditional relational database.
Can you please clarify this whole thing? Hope will get reply soon.
Left by Rakeback on Feb 21, 2010 8:30 PM

# re: Your first NHibernate based application

Requesting Gravatar...
I like this article. I find the information I need. I think I can find more useful information here, thanks.
Left by Full Color Printing on Feb 21, 2010 10:59 PM

# re: Your first NHibernate based application

Left by cheap picture frames on Feb 22, 2010 6:08 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Tutorial is absolutely well and progressive manners. mcitp | mcpd
Left by sam on Feb 22, 2010 7:14 PM

# re: Your first NHibernate based application

Requesting Gravatar...
These kind of post are always inspiring and I prefer to read quality content so I happy to find many good point here in the post, writing is simply great, thank you for the post.
Left by new york web design on Feb 22, 2010 7:33 PM

# re: Your first NHibernate based application

Left by custom essay writing on Feb 22, 2010 10:11 PM

# re: Your first NHibernate based application

Left by adad on Feb 22, 2010 11:44 PM

# re: Your first NHibernate based application

Requesting Gravatar...
great tutorial. I will try this out.
Left by get rid of bed bugs on Feb 23, 2010 2:20 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Nice information. want to look like celebrity and elegant. check out glamorous colors, fine
fabrics, and cutting edge designs dresses and tops by Jovani prom dresses
Left by leo on Feb 23, 2010 5:08 AM

# buy luminary gold

Requesting Gravatar...
Do you knowbuy luminary gold?if you play the online game,you will knowluminary goldis the game gold. In the game,if you had morecheap luminary gold,you will had a tall level. But if you wantluminary online gold,you can come here and spend a little money to boughtluminary money .Quickly come here.
Left by buy luminary gold on Feb 24, 2010 1:25 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Nice information. want to look like celebrity and elegant. check out glamorous colors, fine, Learn it!
Recover Deleted Pictures From Memory Card|Restore Deleted Files|Data Recovery Software|进程保护
Left by Data Recovery Software on Feb 24, 2010 3:58 PM

# re: Your first NHibernate based application

Requesting Gravatar...
I wanted to thank you for this great read. I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post.
Left by Red Caviar on Feb 24, 2010 8:44 PM

# discount ed hardy women long sleeve shirts sales online

Requesting Gravatar...
YS0225A5 If you think you are beaten, you are! If you think you dare noted hardy clothing, you don't! If you want to wn but think you can't, It's almost a cinch you won't ed hardy hoodies! If you think you'll lose,you're lost! For out of the world we find.Success begins with a fellow's will,It's all in a ed hardy shirts state of mind! Life's battles don't always go.To the stronger and faster ed hardy coats man,But sooner or later the man who wins,Is the man who thinks he can! When You Belive http://www.edfashionclothes.com/,Many night we've prayed!With no proof anyone could hear!In our heart a hopeful moncler online store song,we barely understood!Now we are not afraid !Although we know there's much to fear!We were moving the moncler jackets mountian long,Before we knew we could!There can be miracles!
Left by discount mens moncler down coat on Feb 24, 2010 9:59 PM

# discount Ugg Broome Boots in chestnut leather online sales

Requesting Gravatar...
YS0225A8 Before there was no reason in the world,As now there is!The moncler jackets course of water was my only course,My repetitions oceans' sough and swell ugg adirondack boots!My seasons pleasurable,Before there was no reason in the world,As now there is ugg broome boots!To measure time from sleep I rose to sleep,To measure space I pastured on surprise http://www.edhardy-buy.com/,O meadows of resemblances,I was the grove on whose mosaic floors,The moncler online seeds of otherwise were spent,My gods had many arms,I was the Caesar of unmarshaled grass ugg boots!Faustus in the branches,My first ambitions were m sorrows long!Before there was no reason in the world,As now there is!
Left by discount womens moncler jacket on Feb 24, 2010 11:03 PM

# discount air jordan shoes 23 sales online

Requesting Gravatar...
YS0225A7 when the sun hugs the moon, the sky clses her eyes.when the sun hug the moon the sea quiet her jordans shoes.when the sun hugs the moon,the forest stops her susurrus.when the sun hugs the nike sb dunk high,the desert hodlds her breathe.Thousands of years's waiting is only for this nike acg shoes moment.Never be disappointed.Never give up.It hax been sucha long time.At nike air max 2003 this momentmeet each other in course of time.Do not cry,Moon.I grd you forever.Cause you are in my life,everyting has its meaning.The fascinating Diamond Ring,is the ring i give you,May it give you warm http://www.nikejordanshoes2sell.com/ threduce your tears.Do not cry,Sun,I will be there with you forever/Meeting you has given me precious memeory.The resplendent Baily Beads.is the gem i give you .May i give you cheap air jordan 22 shoes strength, shine in your morning.Meet soon and part soon.It makes peop;e retrospect in spite of lasting a few minutes.A long times waiting is coming.Don't know when the next meeting is .When the sun hugs the Moon. the Moon hugs the sun as well Hugging tightly,regian the lost nicety.
Left by discount nike air max shoes sale on Feb 24, 2010 11:07 PM

# discount air jordan shoes 25 sales online

Requesting Gravatar...
YS0225A6 When you beli,Though hope is frail.It's hard to kill,Who knows what cheap prada shoes miracles,You can achieve,When you belive! Somehow you will,

You will when you belive new nike air max!And in this time of fear, When prayer so often proves in vain, Hope seems like the http://www.nikeaf1jordanshoes.com/summer birds. Too swiftly flown away, And now I am standing wholesale gucci shoes here.My heart's so full I can't explain.Seeking faith and speaking women's nike shox words I never thought I'd say, They don't always happen when you ask authentic air jordan shoes.And it's easy to give in to your fear. But when you're blinded by your pain!
Left by discount mens moncler down coat on Feb 24, 2010 11:12 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Being a blogger myself, I am really impressed with your blog and the topics you’ve chosen to discuss.
Left by flex development on Feb 25, 2010 3:34 AM

# discount christian louboutin sandals online sales

Requesting Gravatar...
YS0226A1 That your heart has been broken,Hear the wods,I'm here, my child,;And know your christian louboutin uk angel has spoken.For even in the darkest hour,When all of discount louboutin shoes hope seems gone,They'll give you strength to live your life,And desire to go on.And if your faith in Heaven, Should ever fade away,They'll help renew your christian louboutin boots spirit, And help you find your way.Even though you're ever filled with doubt, About the christian louboutin pumps life you live,Know that they are there to give you All that they can give.For you see, the Father sent them,Because to Him, you mean so much,That He sent them just for you,my louboutin sale friend,And your life, they will touch.They will always be here,They will never leave your http://www.christianlouboutinshoestore.com/ side;And upon their strength and guidance,You always may rely.Take comfort in their guidance, Draw strength from up above,And know that their sweet presence,Is God's precious gift of love.
Left by cheap christian louboutin shoes on Feb 25, 2010 3:31 PM

# discount women's ugg elsey boots 5596 sales online

Requesting Gravatar...
YS0226A2 If I were a boy again, I would practi perseverance more often, and never give up a thing because it was ugg australia boots or inconvenient. If we want light, we must conquer darkness. Perseverance can sometimes equal genius cheap ugg boots in its results. “There are only two creatures,” syas a proverb, “who can surmount the pyramids—the eagle and the snail.” If I were a uggs sale boy again, I would school myself into a habit of http://www.topsnowboots.com/ attention; I would let nothing come between me and the subject in hand. I would remember that a good skater never tries to skate in two ugg cardy boots directions at once. The habit of attention becomes part of our life, if we begain early enough. I often hear cheap gucci shoes grown up people say “ I could not fix my attention on the sermon or ugg coquette book, although I wished to do so” , and the reason is, the habit was not formed in youth.
Left by cheap ugg upside boots 5163 on Feb 25, 2010 3:38 PM

# discount Women's ugg adirondack boots II sales online

Requesting Gravatar...
YS0226A3 Hold fast to dreams.For if dreams die. Lif is a broken-winged bird,That ugg australia boots can never fly.Hold fast to dreams. For when dreams go,Life is a barren ugg tall boots field, Frozen only with snow !You never know until you try; And you never try unless you really try ugg cardy boot. You give it your best shot; You do the best you can. And if you have done everything http://www.uggsnowbootsbest.com/! In your power,and still,The truth of the uggs argyle knit matter is! That you haven\'t failed at all.When you reach for your dreams,No matter what ugg boots they may be,You grow from the reaching;You learn from the trying;You win from the doing.
Left by cheap ugg classic cardy boots on Feb 25, 2010 3:46 PM

# discount reebok nfl jerseys online sales

Requesting Gravatar...
YS0226A4 A true friend is someone who reaches for your hand and tohes your cheap hockey jerseys heart.There's always going to be people that hurt you,so what you have to do is keep on trusting nfl jerseys and just be more careful about who sport jerseys you trust next time around.Make youself a better person and know who you are discount nba jerseys before you try and know someone else and expect them to know you mlb jerseys on sale.Remember:Whatever happens,happens for a reason.How many people actually have 8 true http://www.nfljerseymlb.com/friends Hardly anyone I know.But some of us have all right friends and good friends.
Left by cheap adiads nba jerseys sale on Feb 25, 2010 3:52 PM

# discount ugg sienna miller boots 5818 sales online

Requesting Gravatar...
YS0226A9 Unwearied still, lover by lover,They pae in the cold,Companionable ugg australia shoes streams or climb the air;Their hearts have not grown old;ugg coquette Passion or conquest, wander where they will, Attend upon them still ugg adirondack boots. But now they drift on the still water, Mysterious, beautiful; Among what http://www.uggboots4buy.com/ rushes will they build, By what lake’s edge or pool,Delight men’s mbt shoes eyes when I awake some day.To find they have flown uggs classic cardy away?Before there was no reason in the world As now there is I was the bough bent easy by a ugg boots bird I was the vague blue-grazing flock The sleeping and invisible!
Left by cheap women's ugg elsey boots on Feb 25, 2010 3:56 PM

# discount mens air jordan shoes 13 online sales

Requesting Gravatar...
YS0226A10 When you are old and gray and full of sleep,And nodding by t moncler jackets fire, take down this book! And slowly read jordans sheoes , and dream of the soft look,Your eyes had once, and of their cheap nike shoes shadows deep;How many loved your moments of glad grace,And loved your beauty with nike air force 1 love false or true; But one man loved the pilgrim soul in you,And http://www.onestop-onlineshopping.com/ loved the sorrows of your changing face; And bending down beside the designer clothing glowing bars,Murmur, a little sadly, how love fled.And paced upon the mountains overhead discount air jordan shoes,And hid his face amid a crowd of stars.
Left by cheap nike air max 90 online on Feb 25, 2010 4:01 PM

# discount louis vuitton damier canvas handbags online sales

Requesting Gravatar...
YS0226A11 Surrounding you are angels,They are there to guide your path.If designer purses weaesskn overcomes you,They'll give you strength if you will ask. They are r protection.When discount designer bags on sale life seems too hard to bear,And though you feel alone at times, The louis vuitton 2009 angels ... they are there.Their faces may be hidden And their voices you might not hear,But they are ALWAYS with you,Through your laughter or your tears.http://www.handbags4buy.com/ They'll walk along beside you,They'll guide your leather handbags steps along the way, They'll comfort you and hold you,Protect you dior handbags night and day.They'll hold to your hand tightly ,They'll not ever let it go,And they'll gently lead you cheap designer handbagsforward,Taking each step very slow.For even as you slumber,They watch closely over you;They are there beside you. In each and every thing you do.
Left by cheap nike air max 90 online on Feb 25, 2010 4:08 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Well, this is a very valuable post. Thanks for the information you provided. It would be great if got more post like this. I appreciate it.
Pariuri Sportive Bookmakers Bonus Codes Steroids for sale Online Betting
Left by Pariuri Live Online on Feb 26, 2010 6:13 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Amazing! I love it. seriously.

Jema
Author, NCLEX Review
Left by NCLEX Review on Feb 27, 2010 12:11 AM

# re: Your first NHibernate based application

Requesting Gravatar...
I like this stuff!
Left by Research paper service on Feb 27, 2010 1:29 PM

# re: Your first NHibernate based application

Requesting Gravatar...
NHIbernate based application tutorial that was awesome. It's is very complex to go through all these codes, but it is very interesting and informative. NHibernate is OR/M which helps us to reduce the gap between database and domain model. Nice articles thanks for sharing.
Left by Airsoft Tactical Vest on Feb 27, 2010 5:05 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Hibernate applications really an advanced one to save many things basically. I just started to learn them. Your introduction was very nice..
online casino
Left by online casino on Feb 27, 2010 7:27 PM

# re: Your first NHibernate based application

Requesting Gravatar...

wedding dresses,wedding gowns,bride dresses,bridesmaids dresses,evening dresses,bridal gowns,flower girl dresses
Wedding Gowns
Formal Gowns
Cocktail Gowns
Find the wedding dress designer and wedding dress that's right for you! Browse dresses from
Bridesmaid Gowns
Evening Gowns
View our selection of exquisite, handmade gowns and dresses for your wedding
Wedding Dresses, Wedding Shoes and Wedding Accessories from wedding shop, the UK's finest collection of designer wedding dresses.
Use the wedding dress and
cheap wedding
wedding dresses
wedding shop
bnv
Left by sbb on Feb 27, 2010 10:13 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Hello admin, I must admit that today is my first time I visit here. However, I have found so many interesting thing in your blog and I really love that.
Left by auto insurance on Feb 28, 2010 5:00 AM

# Very good tutorial

Requesting Gravatar...
This is actually a fantastic tutorial that stands on its own two feet. More depth could be added into the mapping file(s), but for what it does, it does quite well. It's is very complex to go through all these codes, I'll give it trial.


poker bonus codes
Left by addison on Feb 28, 2010 5:50 PM

# re: Your first NHibernate based application

Left by JJ on Mar 01, 2010 12:11 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Low rate search. Low rates on loans, credit, insurance, travel & more. Find low rates and cheap prices here. Bad credit ok. We can help. Visit LowRateSearch.com to get started now.
Left by low rates on Mar 01, 2010 8:13 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Interesting read. You should probably follow it up with more examples involving joins, subqueries etc. Thanks for including all those sample codes, makes life easier when I try something that already works before I make my own changes ;-)
Grand National
Left by Martin Wilmer on Mar 01, 2010 4:39 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Read the article and got to learn alot of stuff. Kudos on the artcile, keep it coming. Nice read
Left by Term papers on Mar 02, 2010 10:12 AM

# re: Your first NHibernate based application

Requesting Gravatar...

wedding dresses,wedding gowns,bride dresses,bridesmaids dresses,evening dresses,bridal gowns,flower girl dresses
Wedding Gowns
Formal Gowns
Cocktail Gowns
Find the wedding dress designer and wedding dress that's right for you! Browse dresses from
Bridesmaid Gowns
Evening Gowns
View our selection of exquisite, handmade gowns and dresses for your wedding
Wedding Dresses, Wedding Shoes and Wedding Accessories from wedding shop, the UK's finest collection of designer wedding dresses.
Use the wedding dress and
cheap wedding
wedding dresses
wedding shop


qwer
Left by sbb on Mar 02, 2010 8:10 PM

# re: Your first NHibernate based application

Requesting Gravatar...
We have also defined that we want to see the SQL NHibernate generates and sends to the datbase (highly recommended for debugging purposes during development).
Electronic Cigarette Reviews()Blu Cigs E-Cigarette
Left by benkol on Mar 02, 2010 10:58 PM

# re: Your first NHibernate based application

Requesting Gravatar...
thanks for sharing this wonderful information after this tutorial it will become more easy to workout
Left by Research Paper on Mar 02, 2010 11:42 PM

# re: Your first NHibernate based application

Requesting Gravatar...
PortableSolarPanels-forSale.com sells Portable solar panels, solar roof panels, solar powered toys and solar power guides. Also provide article about solar energy facts and solar energy blog.Solar energy facts you must know. Solar energy general facts, solar energy facts interpreting usage, facts about systems utilized for producing solar energy, interesting facts about solar energy.Solar energy pros and cons. Pros greatly outweighs the cons of solar energy.
Left by bucksgens on Mar 03, 2010 3:06 AM

# re: Your first NHibernate based application

Requesting Gravatar...
We now have to tell NHibernate which database product we want to use and provide it the connection details in form of a connection string. NHibernate supports many many database products!
Download Youtube Videos()http://3roms.com/">Download Roms
Left by mania on Mar 03, 2010 8:48 AM

# re: Your first NHibernate based application

Left by macsonuclari on Mar 03, 2010 8:59 AM

# re: Your first NHibernate based application

Requesting Gravatar...
This mapping can be done either by defining a mapping file (an xml-document) or by decorating the entity with attributes. I'll start with the mapping file.
Download Roms
Left by kioon on Mar 03, 2010 9:25 AM

# re: Your first NHibernate based application

Requesting Gravatar...
For some people, there are no such better things that the internet. For them, this would be the excellent way to get many kinds of things. As we all know, there are so many kinds of online stores in the internet. For some of us, the online stores would be the excellent options to spend some money. We wouldn’t have to go anywhere as long as we have the internet connection. We would only need to click the site and try to get the perfect options for them. links of london There are many excellent options that they would be able to get. There are many kinds of things that were provided by many kinds of stores.
Left by ppsdtw on Mar 03, 2010 5:35 PM

# ugg boots

Requesting Gravatar...

they are very good and useful!!!
ugg outlet
[url=http://www.cheap-uggs-online.net]cheap uggs[/url]
cheap uggs http://www.cheap-uggs-online.net

Left by ugg boots on Mar 03, 2010 6:49 PM

# re: Your first NHibernate based application

Requesting Gravatar...
中国大型领先专业招聘网站招聘销售
外汇保证金交易是利用外汇而进行的交易
环球外汇交易 在世界最受欢迎的外汇交易
中国大型广告联盟评测网
Left by 外汇 on Mar 04, 2010 6:35 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Fast online pricing for Dell's Equallogic SAN from an Dell Authorized Reseller. Guaranteed lowest pricing.Equallogic Prices
Left by Equallogic Prices on Mar 04, 2010 10:20 PM

# re: Your first NHibernate based application

Left by discount on Mar 05, 2010 12:26 AM

# re: Your first NHibernate based application

Requesting Gravatar...
I am always searching online for articles that can help me. Thank you
Powerpoint Converter
Left by powerpoint on Mar 05, 2010 9:17 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Thank you for this excellent tutorial. I found it extremely helpful to get going with nHibernate and TDD.
Left by ucvhost on Mar 06, 2010 2:58 AM

# re: Your first NHibernate based application

Requesting Gravatar...
this is a great article! fotograf zdjecia slubne and fotografia slubna bielsko Katowice krakow fine art. Psycholog on Line korzysci pomocy online fotografia dziecieca zdjecia dzieci, fotografia ślubna fotografia ślubna bielsko fotografia dzieci zdjęcia ślubne bielsko depresja stres psycholog i pomoc psychologiczna pomoc psychologa and internetowy psycholog psychologia internetowa poradnia psychologiczna and Psychologia and psycholog online psycholog on-line pomoc psychologiczna przez Internet and psycholog online psycholog internetowy and psycholog przez internet
Left by mimke on Mar 06, 2010 8:08 AM

# re: Your first NHibernate based application

Requesting Gravatar...
awesome results…really liked it
Left by Unterwaesche Online Shop on Mar 06, 2010 11:56 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Based application for information about NHibernate, thanks.
Left by Cennet Cehennem on Mar 06, 2010 8:55 PM

# ugg boots

Requesting Gravatar...


they are very good and useful!!!
ugg outlet
cheap uggs
nike shoes
wholesale watches 8963
Left by ugg boots on Mar 07, 2010 5:30 PM

# re: Your first NHibernate based application

Requesting Gravatar...
It’s hard to find knowledgeable people on this topic, but you sound like you know what you’re talking about! Thanks Don’t stop writing, you’ve given me lots of good info! Youtube to MP4 Converter
Convert PDF to image
1
Left by powerpoint on Mar 08, 2010 2:14 PM

# re: Your first NHibernate based application

Requesting Gravatar...
I have bookmark it!hope for your arctical more!My hair is just over my ears. I like two kinds of hair styles most. Firstly, use the ghd straighteners to make

the hair in nature and bouffant style. Divide the hair into several portions. Use ghd pink to roll them inside

towards your ears. Several minutes later, the hair will roll neatly inside in the branches. Secondly, the active and energetic style with the roll of the

direction in the opposite direction can be made similarly with the formal procedure. All you need to do is to roll the hair outward instead of inward

with ghd mk5.
It is so simple that you can have your own charming short hair style with GHD straightener uk. Besides the new hair styles,ghd straighteners can help you with the puffy hair after you get up which is the annoying thing for many short hair

girls.
So as long as I have the good tool of ghd pink, no matter what the fashion trend goes of hair styles, I will

stick into my favorite neat short hair.
My hair is just over my ears.
Left by ghd straighteners on Mar 09, 2010 3:37 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Your work is very good and I appreciate you and hopping for some more informative posts. thank you for sharing great information to us
Left by Equity Release on Mar 09, 2010 6:36 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Your work is great and I appreciate you and hopping for some articles for more information. Thank you for sharing information with our large Thesis AND Dissertation AND Essay AND Assignment
Left by Alice on Mar 09, 2010 9:51 PM

# re: Your first NHibernate based application

Requesting Gravatar...
My fat on gold
Left by Biber hapı on Mar 10, 2010 1:58 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Thanks that you share all this whit us. I hope you bring more news.vanzari auto dezmembrari masini
OK from all.
Left by bogdan on Mar 10, 2010 6:17 AM

# Chapel Hill Real Estate

Requesting Gravatar...
This is a really nice article. I am sure a lot of people will benefit from it. Thanks!
Left by Chapel Hill Real Estate on Mar 10, 2010 7:44 PM

# re: Your first NHibernate based application

Requesting Gravatar...
I appreciate this post.It’s hard to find knowledgeable people on NHibernate, but you sound like you know what you’re talking about!
Left by got debt on Mar 10, 2010 9:00 PM

# re: Your first NHibernate based application

Requesting Gravatar...
There are certainly a lot of details like that to take into consideration.I read and understand the entire article and I really enjoyed it to be honest.
cheap vps | cheap hosting
Really this is an from expert..thanks
Left by ucvhost on Mar 10, 2010 11:51 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Lovely article.offering to get the best mortgage rates for many different kinds of loan categories. find the best mortgage rates so you can save money when making your largest and most important purchase
Left by best mortgage rates on Mar 11, 2010 1:31 AM

# re: Your first NHibernate based application

Requesting Gravatar...
This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! keep up the good work.
Left by Replacement Windows on Mar 11, 2010 2:10 AM

# re: Your first NHibernate based application

Requesting Gravatar...
I find you website through bing, I was deeply interested by your post. Thanks for great work.
Left by free ringtones on Mar 11, 2010 8:18 AM

# re: Your first NHibernate based application

Requesting Gravatar...
If you need directions in life and not only directions, but the driving directions. You want to take the best decisions for you, and never miss your opportunities and reach your full potential. But let me ask you a question: Have you always taken the right decisions? Have you always got the perfect directions? Few years ago mapquest driving directions usa designed a peace plan for Middle East, it was called УThe road mapФ. They were determined to follow it and to bring peace in that troubled area. I donТt know if that plan worked or not, but I know is not peace in that area now mapquest driving directions.
Left by usa mapquest on Mar 11, 2010 8:27 AM

# re: Your first NHibernate based application

Requesting Gravatar...
This is my first time i visit here.
Left by rolex on Mar 11, 2010 3:24 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Good information. Very helpful
Left by Female tattoos on Mar 12, 2010 5:17 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Potential amalgam-induced health risks which have been studied by researchers include those related to allergy as well as toxicity.
Left by low cost dental plans on Mar 13, 2010 3:17 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Thanks for sharing the use of NHibernate as an ORM tool.
Left by out of control teen on Mar 15, 2010 1:13 AM

# re: Your first NHibernate based application

Requesting Gravatar...
I think this code should also be in c#
Left by seo company on Mar 15, 2010 1:17 AM

# re: Your first NHibernate based application

Requesting Gravatar...
yes C# and .net
Left by cheap lcd tv on Mar 15, 2010 3:42 AM

# re: Your first NHibernate based application

Requesting Gravatar...
Thanks for sharing the use of NHibernate as an ORM tool. Directory Submission Blog Posting Service Social Bookmarking Submission


Left by Link Building Services on Mar 15, 2010 4:15 AM

# re: Your first NHibernate based application

Requesting Gravatar...
This is the first time, i will come on your blog. I like a lot.
Left by Du hoc uc on Mar 15, 2010 4:20 PM

# re: Your first NHibernate based application

Requesting Gravatar...
Thanks for such a great post and the review, I am totally impressed! Keep stuff like this coming.
Left by nursing resume on Mar 15, 2010 6:06 PM

# links of london

Requesting Gravatar...
one day i went shopping outside,and in an ed hardy store,I found some kinds of ed hardy i love most they are Your website is really good Thank you for the information links of london rings links of london rings cheap links of london rings cheap links of london rings discount links of london rings discount links of london rings uk links of london rings on sale uk links of london rings on sale links of london pendants links of london pendants cheap links of london pendants cheap links of london pendants discount links of london pendants discount links of london pendants links london pendants sale links london pendants sale uk links of london pendants on sale uk links of london pendants on sale links of london silver chain links of london silver chain Thank you for the information
Left by links of london on Mar 15, 2010 7:39 PM

# re: How to setup a new solution

Requesting Gravatar...
To the world you Christian Louboutin sale may be one person Christian Louboutin shoes but to one person Christian Louboutin Pumps you may be Christian Louboutin Sandals the world.sds
Left by Discount Christian Louboutin on Mar 15, 2010 10:33 PM

# re: Your first NHibernate based application