I have used Fluent NHibernate to auto map for Oracle database. My Domain class have some Oracle key words as property names. Example: Group is a key word in Oracle. When we use Group as a column the it needs to be enclosed within quotes (like "Group"). How can we take care of this in Fluent NHibernate?
I have modified the IColumnInstances to add ColumnName method and added a Convention. After adding this code it is throwing another error "ORA-00907: missing right parenthesis". Is there any alternate solution?
Here is the code
public class ColumnNameConvention : IColumnConvention
{
public void Apply(IColumnInstance instance)
{
try
{
if (instance.Name.Length > 30)
{
instance.ColumnName(instance.Name.Substring(instance.Name.Length - 25, 25));
}
else
{
instance.ColumnName("\"" + instance.Name + "\"");
}
instance.Length(200);
}
catch (System.Exception ex)
{
throw ex;
}
}
}