开发者

NHibernate new SchemaExport(cfg).Execute(false, true, false, false); No fourth bool parameter

I'm trying to follow the NHibernate tutorial, "Your first NHibernate based applicaton:Revision #4" at NHibernate Forge.

But the line: new SchemaExport(cfg).Execute(false, true, false, false);

Will not compile because it says there is no overload that takes four boolean paramaeters!

I am using NHibernate 2.1.2 in Visual Studio 2008 C#. All the samples I have seen clearly use this call with four boolean parameters. Has something changed in the latest version of NHibernate with the call to S开发者_运维百科chemaExport()?

I am trying to create a simple table in my database in a test method. I am using MS SQL Express 2008 as my database. I have tried the Create(true, true) call and it at least compiles and runs, but the table never seems to persist in the database.


Yes, it changed from NH2.0.xGA to NH2.1.0:

In SchemaExport.Execute the parameter "format" was removed; (NH-1701) enabled configuration property format_sql (default true)

It used to be:

void Execute(bool script, bool export, bool justDrop, bool format)

Now it's:

void Execute(bool script, bool export, bool justDrop)

so just remove the format parameter. This was replaced by the format_sql config property:

<property name="format_sql">true</property> 

Here's the corresponding issue.


Add this item:

using NHibernate.Tool.hbm2ddl;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜