SubSonic Oracle and properties case

风流意气都作罢 提交于 2019-12-11 16:42:13

问题


I don´t know the answer for this question.

With MSSQLSERVER and MYSQL the next configuration runs very well but with Oracle don´t.

With Oracle appear like this

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

With MSSQL AND MYSQL

c.IdCargo = 1;

How to configure the connection with Oracle to appear "IdCargo" and not "Idcargo". ??

THE CONFIGURATION:

    <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:


Valmir, What does the definition of your Cargo Table look like? I am betting that your error is coming from Oracle and not SubSonic if your definition looks something like this

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

Than your property in subsonic will not come across as ldCargo. This is due to the fact that Oracle stores all of the column names and table names as upper case. You would need to change ldCargo to ld_cargo if you would like to have it come across in SubSonic as camel case (SubSonic will remove the "_" for you)




回答2:


As runxc1 says Oracle does not respect case for column/table names, your regexdictionaryreplace config is, I imagine, hiding the issue for tables. You can force oracle to be case sensitive in your db creation scripts by surrounding table/column names with quotes however I believe that has it's own drawbacks:

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

Since you are having the same problem with MySql I would suggest you move to using underscores (once again as runxc1 says) for your db table/column naming conventions then you can remove the regexdictionaryreplace completely.



来源:https://stackoverflow.com/questions/1095767/subsonic-oracle-and-properties-case

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!