2009-07-08 68 views
0

我不知道這個問題的答案。SubSonic Oracle和屬性案例

使用MSSQLSERVER和MYSQL,下一個配置運行得非常好,但是Oracle不會。

與甲骨文似乎是這樣的

貨物c = new Cargo(); c.Idcargo = 1;

使用MSSQL和MYSQL

c.IdCargo = 1;

如何配置與Oracle的連接以顯示「IdCargo」而不是「Idcargo」。 ??

配置:

<providers> 
     <clear/> 
     <add name="oracle" type="SubSonic.oracleDataProvider, SubSonic" 
    connectionStringName="oracle" 
    fixDatabaseObjectCasing="true" 
    regexDictionaryReplace="Empresaendereco,EmpresaEndereco;Empresacontato,EmpresaContato;Franqueadoendereco,FranqueadoEndereco;Franqueadocontato,FranqueadoContato;Funcionarioacesso,FuncionarioAcesso;Funcionarioendereco,FuncionarioEndereco;Funcionariocontato,FuncionarioContato;Clienteendereco,ClienteEndereco;Clientecontato,ClienteContato;Clientehistorico,ClienteHistorico;Agendastatus,AgendaStatus;Historicostatus,HistoricoStatus" 
    generateRelatedTablesAsProperties="true" 
    fixPluralClassNames="false" 
    generatedNamespace="ModeloDados" 
    regexIgnoreCase="false" 
    removeUnderscores="false" 
    setPropertyDefaultsFromDatabase="true" 
    generateNullableProperties="true" 
    useExtendedProperties="true" useUtc="true"/> 
    </providers> 

回答

1

瓦爾米爾,什麼是您的貨物表的定義是什麼樣子?我打賭你的錯誤是從甲骨文,而不是來自亞音速如果你的定義看起來像這樣

Create Table Cargo(
ldCargo Decimal(12,0)) 

比亞音速的財產ldCargo不會遇到。這是由於Oracle將所有列名和表名稱作爲大寫字母存儲的事實。如果您希望在亞音速遇到駱駝情況(SubSonic將刪除您的「_」),則需要將ldCargo更改爲ld_cargo

+0

嗨runxc1,我在web.config中創建一個多個領域的表像Descricao_Teste與課程設置removeUnderscores的=「真正的」 這樣的工作..... 我試圖創建表的列駱駝案件,但在甲骨文始終保持大寫。 你知道解決這個問題的其他方法嗎? – Valmir 2009-07-08 18:09:14

+0

你應該不需要設置刪除underscores =「true」,因爲它是默認值。當我有一列名爲c_test_info_id的SubSonic時,使用所有默認值將SubSonic轉換爲CTestInfoId – 2009-07-08 18:23:01

0

由於runxc1表示Oracle不尊重列/表名,我想,你的regexdictionaryreplace配置隱藏了表格的問題。 您可以強制甲骨文帶有引號表/列名在你的數據庫創建腳本大小寫敏感的,但是我相信,有它自身的缺點:

http://www.dbforums.com/oracle/1005513-column-name-any-convention.html#post3705627 http://oracle.ittoolbox.com/groups/technical-functional/oracle-apps-l/column-name-case-771715

既然您有同樣的問題MySql我建議你移動到爲你的數據庫表/列命名約定使用下劃線(再次作爲runxc1說),那麼你可以完全刪除regexdictionaryreplace。