Wednesday, January 29, 2014

NHibernate Journey (1) – “show_sql”

I am following Your first NHibernate based application to start my NHibernate journey.

In the article, it uses NUnit for test, but I have to use MSTest as I am using VS Express 2013 in which NUnit GUI cannot be installed.

I have set “show_sql” to true in the hibernate.cfg.xml when first time test Add method of product repository and there was not

SQL statement outputted. Until I was running “session.Get<Product>” then there was SELECT statement appearing in the output of the

test. According to the article, there suppose to be INSERT statement appearing in the output as well when adding new product to the

database. What is wrong?