c# - NHibernate SchemaExport does not create tables when "script" is false -


Making my first step with NHibernate, I am trying to make it my own tables with HBM files automatically. The database backend is SQL Server 2008 Developer Edition.

This is the normal sample code I see in the NHibernate tutorial:

  var cfg = new configuration (); Cfg.configure (); Cfg.AddAssembly (typeof (posting) .asembly); New Schemaxport (CFG) Excrete (false, true, false, false);  

Unfortunately, this does not work, I've set show_sql to the right, and it does not print any statement. Looking at the SQL Profiler, I am adding my application to DB, but I am not doing anything.

I can correct this by changing the first parameter ("script") to fix it:

  New Schemaxport (CFG). Define (True, True, False, true);  

I did not understand why the schemaexport parameter is unfortunately not explained in real terms (there is no difference between them. And interpretation), and I would like to find out What does this parameter do, and why it is not needed or while using the SQL Compact version (which works, the script is false)

SchemaXport HBM2Did The LL is part of the utility that is actually separate from the NHibernate functionality, it does not use "show_sql" which is used for NHibernate purposes.

To get a copy of the schema you used. SetOutputFile (filename)

This method is when I want to create a new database, then I use a formatted schema in the MyDDL.sql file and the database is built from schema:

Private Zero BuildSchema {Configuration Configuration} {New SchemaExport (Configuration) .setoutoutfile (_fileName + "MyDDL SQL") .Execute (True / * Script * /, True / * Export to DB * / , False / * bus drop * /, true / * format schema * /); }

SchemaExport.Create is just a shortcut for schema. Just leave the lie and get acquainted with the correct format.

  Generate Public Zero (bool script, export bool) {execute (script, export, wrong, true); }  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -