开发者

MVC + Nhibernate + Oracle Schema Configuration

开发者 https://www.devze.com 2022-12-27 03:42 出处:网络
Our customer wants us to use a connectionstring with username = "external" and add schemaName "original" infront of our queries like:

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

精彩评论

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