Missing quotes for Firebird columns and tables
As you know, using column names not in uppercase(for example Address, address) demands quoting in firebird syntax.
I have:
Firebird .net provider 2.5.2
Fluent Nhib Build 633
Table in Database:
CREATE TABLE TABLETEST (
ID INTEGER NOT NULL,
NAME VARCHAR(50),
"Address" VARCHAR(100) -- problem with this field
);
ALTER TABLE TABLETEST ADD PRIMARY KEY (ID);
In my project i have User class
public class User
{
public virtual int Id { get; private set; }
public virtual string Name { get; set; }
public virtual string Address { get; set; }
}
and mapping for it
public UserMap()
{
this.Table("TABLETEST");
Id(x => x.Id).Column("ID").GeneratedBy.Sequence("GEN_TABLETEST_ID");
Map(x => x.Name).Length(50).Column("NAME");
Map(x => x.Address).Column("Address").Length(100); -- explicitly specify column name
}
When i try to save some simple entity into this table, i receive exception:
"could not insert: [project.Mappings.User#13][SQL: INSERT INTO tabletest (name, address, id) VALUES (?, ?, ?)]" inner exception: "Dynamic SQL Error\r\nSQL error code = -206\r\nColumn unknown\r\nADDRESS\r\nAt line 1, column 30"
Of course, firebird doesn't understand ADDRESS, 'cause it is case-sensetive, and i have "Address" in my db table.
I have tried using backtips and Map.Access in my mapping, it doesn't helps. Also tried different keys from solution described here http://fabiomaulo.blogspot.com/2009/06/auto-quote-tablecolumn-names... . I cannot change existing database metadata due to its usage in another application.
Q: Is there some possibility to pass into SQL quoted columns?