How to change the property name through conventions?
Hi,
I'm having a problem with reserved names in Oracle during automapping schemaExport.
The schema export generates the following DDL:
create table MYTABLE (
id RAW(16) not null,
Comment NVARCHAR2(255),
primary key (id)
)
When executed i get an ORA-00904: : invalid identifier exception.
It seems like 'COMMENT' name is a reserved field
if i change comment -> comment the sql executes propertly.
How can i change comment -> comment using the convention interface in Fluent?
regards,
Lars.
Comments are currently closed for this discussion. You can start a new one.
2 Posted by Lars on 07 Mar, 2010 06:41 PM
hmm html formating issues:
comment -> comment___
Support Staff 3 Posted by James Gregory on 09 Mar, 2010 02:44 PM
Hey Lars,
You should look into creating an
IPropertyConvention
, and use theColumn
method to change the column name.Something like this should work:
You should also consider looking into the hbm2ddl.keywords NHibernate property, which can do auto-escaping of reserved keywords.
James Gregory closed this discussion on 18 Mar, 2010 12:17 PM.