Making my first steps with NHibernate, I'm trying to have it creating my Tables automatically from the hbm files. The database backend is SQL Server 2008 Developer Edition.
This is the common sample code I see in NHibernate Tutorials:
var cfg = new Configuration();
cfg.Configure();
cfg.AddAssembly(typeof(Posting).Assembly);
new SchemaExport(cfg).Execute(false,true,false,false);
Sadly, this does not work. I have set show_sql to true, and it does not print out any statement. Looking at SQL profiler I see my Application connecting to the DB, but then doing nothing.
I can fix that by changing the first parameter ("script") to true:
new SchemaExport(cfg).Execute(true,true,false,true);
I don't understand why. The parameters of SchemaExport are sadly not really explained (also not the difference between .Create and .Execute), and I would like to find out what this parameter does, and why it's not needed i.e. when using SQL Compact Edition (that works also when script is false)