FluentNHibernate:映射问题

时间:2011-09-07 20:45:46

标签: nhibernate fluent-nhibernate

1)为什么SchemaMetadataUpdater.QuoteTableAndColumns不更新(scape)架构名称?我如何更新架构?我有保留架构的问题,因为关键字是MsSql,如'Statistics'。但是,可以使用'[Statistics]'修复此问题。

2)如何根据特定条件覆盖ManyToMany关系的默认模式;不是全局默认架构?

更新

2.1)当你定义User和Role之间的ManyToMany关系时,NHibernate会自动生成UserRole表来处理这个关系人员。现在我们可以轻松地更改Role和User表的模式,但是我们无法访问UserRole,因此我们无法为其指定模式。我的问题是如何更改此类表的架构?

感谢的

1 个答案:

答案 0 :(得分:1)

  

在nhibernate的基本XML映射中,您将使用`(grave accent - the other character on the tilda key (~) below the esc key) this is the native escape >character for nhibernate and translates it to the correct escape character for the database dialect you are using. so nhibernate will traslate`Statistics``将表/列名称转义为[Statistics] for MSSql

2)请你扩展一下。因为你不清楚自己要做什么。

抱歉格式化。降价正在严重诠释严重的口音。