2011-09-07 136 views
0

1)爲什麼SchemaMetadataUpdater.QuoteTableAndColumns不更新(scape)模式名稱?我如何更新模式?我有一個保留模式的問題,因爲關鍵字是MsSql,如'Statistics'。但是,這可以通過使用'[Statistics]'來解決。FluentNHibernate:映射問題

2)如何根據特定條件覆蓋ManyToMany關係的默認模式;不是全局默認模式?

UPDATE

2.1)在定義用戶和角色之間的多對多關係,自動地被NHibernate的用於處理這種關係人員產生的UserRole表。現在我們可以輕鬆地更改角色和用戶表的模式,但我們無法訪問UserRole,因此我們無法爲其指定模式。我的問題是如何改變這種類型的表的模式?

感謝的

回答

1

在基礎XML映射NHibernate的,你會逃避與`(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``表/列名[統計]爲MSSQL

2)可以請你擴大。因爲你不清楚你在做什麼。

對於格式化感到抱歉。減價正在與嚴重的重音密鑰混戰。

+0

感謝Nathan的回答。對於我的問題的第二部分閱讀這篇文章後http://wiki.fluentnhibernate.org/Available_conventions我已經解決了我的問題很容易購買使用IJoinedSubclassConvention,IHasManyToManyConvention和改變模式。 – Sadegh