Page 1 of 1

EF Model First and devart for both oracle and sql server

Posted: Fri 01 Oct 2010 16:23
by joeu
How would i go about using the "Model first" approach that would work for both oracle and sql server?
(obviously i would like to create only one model that works for both)

Could i then create both db schemas from this?

thanks
joe

Posted: Mon 04 Oct 2010 11:24
by AndreyR
The most straightforward way to achieve the appropriate results is to create a model for SQL Server, and then generate the database script for the Oracle database. After some minor SSDL adjustments there should be two models using the same CSDL and MSL, with the different SSDL layers.
Don't forget to set the correct metadata paths in the connection strings.
Take a look at this post concerning the work with MSSQL and Oracle, for example.

Posted: Tue 05 Oct 2010 14:28
by joeu
so far i:
#created a model for sql

#copied the model objects to another model (oraModel) and used the devart .tt to generate a sql script

#edited the ssdl to remove the schema="MyUser"

#fixed the app.config to point to new ssdl

1. The sql script generated contained a schema name prefix on every table that was quoted and therefore not recognised,
1. Is there a way to stop this being quoted?
2. Is there a way to stop this being added in the first place?
3. Is there a better way to create the sql script?

4. Is there a way to stop the schema="MyUser" being added to the ssdl?

3. Why are the table names quoted in oracle? e.g tableA in Sql is "tableA" in Oracle

4. why are the column names quoted in oracle? e.g columnA in Sql is "columnA" in Oracle

Posted: Fri 08 Oct 2010 11:51
by AndreyR
Go to the %Program Files%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\Devart SSDLToSQL.ttinclude file.
It contains the Quote method.
You can adjust the generation of the schema name, and schema name and column quoting by modifying this method.

Posted: Tue 12 Oct 2010 14:11
by joeu
having everything quoted looks odd, can you explain why you decided to quote table names, column names etc?

How hard would it be to undo this?

if I remove the quotes in the script surely there is another file that pre-defines the quotes that are created during the construction of the queries that i would need to modify?

Thanks
Joe

Posted: Thu 14 Oct 2010 14:33
by AndreyR
Actually the quoting in the generated script is designed to preserve the original case of names.
Is the unnecessary quoting in queries reproducible using the latest build?