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?
Is there a auto quoting option for Entity Developer to add quote sign to table and column names?
Re: Is there a auto quoting option for Entity Developer to add quote sign to table and column names?
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
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
Re: Is there a auto quoting option for Entity Developer to add quote sign to table and column names?
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?
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?
Re: Is there a auto quoting option for Entity Developer to add quote sign to table and column names?
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.
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.
1. You installed the Npgsql provider to get access to PostgreSQL Server, didn't you?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.
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.