It took me a long time but I finally got nHibernate\'s Hello World to work. It worked after I did \"lazy loading.\" Honestly, I couldn\'t tell you why it all worked, but it di
If you're using hbm.xml files for you mapping simply adding a lazy="false"
to the
element will get you non-lazy loading for all simple properties. Foreign entities will still be lazy by default. To make them eager add lazy="false"
to the mapping element. One benefit of eager loading is you will no longer need virtual properties on your entity classes.
Edit: If you really want to find out what's going on behind the scenes, NHibernate logs everything using log4net. Adding
inside
in your web.config will spit all the SQL NHibernate generates the file c:\logs\sql.log