Is there a auto quoting option for Entity Developer to add quote sign to table and column names?

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
yww325
Posts: 2
Joined: Mon 04 Jul 2016 01:20

Is there a auto quoting option for Entity Developer to add quote sign to table and column names?

Post by yww325 » Mon 04 Jul 2016 01:29

Hi,
We're using Postgres sql as one of the supported database. But our existing DB's table and column names are UPPER cased.
When using NHibernate's hbm.xml generated by Entity Devloper, we retrieved error like:
Npgsql.PostgresException : 42P01: relation "users" does not exist
We would like to keep the table and column names UPPER cased, and DB is case sensitive. And we want to use xml for mapping instead of fluent NHiberate.
So although there is a possible solution. https://jporwol.wordpress.com/2012/07/2 ... e-columns/
We don't want to adapt that. And if we manually add quotes to table and column names in Entity Developer, they will be flushed every time we change the DB design and updated entity from DB to Model with Entity Developer.
Any suggestions?

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: Is there a auto quoting option for Entity Developer to add quote sign to table and column names?

Post by Shalex » Mon 04 Jul 2016 16:30

Entity Developer quotes the table / column names with letters in upper case by default in case of the Database First approach.

1. Please create a new NHibernate model with Create Model Wizard (Database First), add one database table with upper case letters in its name to the model. Then check the value of the Table property of the created class in the model, is it quoted?
2. Specify the exact (x.x.x) versions of your:
a) Entity Developer
b) Npgsql provider

yww325
Posts: 2
Joined: Mon 04 Jul 2016 01:20

Re: Is there a auto quoting option for Entity Developer to add quote sign to table and column names?

Post by yww325 » Thu 07 Jul 2016 04:28

No it's not quoted. I used Entity Developer Express version, I didn't see a Postgres SQL provider when I use DB first approach. Only .net framework data provider for SQLServer and .net framework data provider for Oracle.So I can only import with DB first approach with MSSql server(I managed to sync the schema between two DBs). But when I using the model, I use them against Postgres DB.

Does that mean I need to purchase a ntity Developer for NHibernate in https://www.devart.com/entitydeveloper/editions.html
to get Npgsql provider support?

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: Is there a auto quoting option for Entity Developer to add quote sign to table and column names?

Post by Shalex » Thu 07 Jul 2016 14:09

The list of supported providers is available at https://www.devart.com/entitydeveloper/ ... ility.html. The providers are not supplied with Entity Developer, they should be installed separately.
I used Entity Developer Express version, I didn't see a Postgres SQL provider when I use DB first approach. Only .net framework data provider for SQLServer and .net framework data provider for Oracle.So I can only import with DB first approach with MSSql server(I managed to sync the schema between two DBs). But when I using the model, I use them against Postgres DB.
1. You installed the Npgsql provider to get access to PostgreSQL Server, didn't you?
2. The table name with upper case letters are quoted in the Table property of the model class if you import table directly from PostgreSQL. If you import table from SQL Server first, you should set quoted name in the Table property of the model class manually when switching to PostgreSQL.

Post Reply