开发者

MVC + Nhibernate + Oracle Schema Configuration

Our customer wants us to use a connectionstring with username = "external" and add schemaName "original" infront of our queries like:

"select columnA from original.TableA"

  • I dont want to change mappin开发者_Go百科g files which are shared by other projects,

  • tried adding default schema as:

    <property name="default_schema">original</property>

But this doesn't work. Any Help?


At the end i added a key to the application settings and include default schema to the fluent nhibernate configuration.

Fluently.Configure().
Database(OracleClientConfiguration.
Oracle10.Dialect<Oracle10gDialect>().
Driver<OracleDriver>().
DefaultSchema(defaultSchema)


Using the defaultSchema as outlined in the answer below does not work for us. We have to call 'alter session set schema=' on our session. Otherwise we get the error "table or view not found'.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜