LLBLGen Pro 3.1 Final.
I am dealing with a legacy database that has numerous columns with spaces in the name. The legacy database has been ported to SQL Sever 2008. SQL Sever, LLBLGen, .Net (4.0) all have no problem with these names.
However, when NHibernate is generating SQL code, the queries fail because of these spaces. The names are not bracketed.
LLBLGen generates, for example, the following mapping code:
Map(x=>x.ActivtyTypeNam).CustomType("StringClob").Column("Activty TypeNam") .Access.CamelCaseField(Prefix.Underscore);
When I manually change that to:
Map(x=>x.ActivtyTypeNam).CustomType("StringClob").Column("[Activty TypeNam]") .Access.CamelCaseField(Prefix.Underscore);
(notice the square brackets) the queries work.
So, is there an LLBLGen setting that will automatically add those brackets for properties that have spaces (without changing something on each individual field - I have hundreds of them)?
Or, can you give me pointers on modifying the code generation templates to add the brackets whenever the '.Column()' method is used?
Thanks,
Steve