I am switching my application to Postgresql, All the tables in my schema are in lowercase and when I'm doing a query with NHibernate it is adding double quotes to the table name which on the mappings is in PascalCase and causing the query to fail telling me that the table does not exists.
I could easily go to all the mappings classes and change the Table method to be lowercase, like change from 'Table("UserAccount")' to 'Table("useraccount")' but I'd rather prefer not having to do this..
I was wondering if there is any way to tell nhibernate not to Double Quote the table on the queries so it'll find it correctly.
I tried with this:
PostgreSQLConfiguration.Standard.Raw("hbm2ddl.keywords","none").ConnectionString(x => x.Is(_connectionString));
and it did not work. I would pretty much tell nhibernate not to worry about case, but having trouble to do this with postgres.
You could change this behavior using Fluent NHibernate's IClassConvention. I guess here is no other way to do it according to this question
来源:https://stackoverflow.com/questions/6283511/disable-table-name-double-quoting-on-fluentnhibernate