You don't need a NaningStrategy to do it neither in NH3.0.0 noe NH2.1.2 http://fabiomaulo.blogspot.com/2009/06/auto-quote-tablecolumn-names.html
On Wed, Dec 8, 2010 at 2:54 PM, Mike Bell <[email protected]>wrote: > So i just updated to NH 3.0 GA from NH 2.1.2 GA. All looks ok so far > except one small issue. I have some table names that are the same as SQL > 2008 keywords (user, lookup, etc). I had previously written a > NamingStrategy that implemented INamingStrategy. Previously if you had > columns or tables with the same name as a key word you could do somehitng > like the follwing to force brackets around the column or table names: > > public string ColumnName(string columnName) { return String.Format("`{0}`", > columnName.ToLower()); } > > This generated nice table names and column names ([user], [lookup], etc). > For some reason I am now getting strange query output for table and column > names (['user'], ['lookup'], etc.) I realize that this is because of my > NamingStrategy but I'm not sure how to resolve this because if i remove the > ` (back tick) character and my string format (no longer needed) the columns > and table names no longer get brackets which then causes me to run into the > keyword syntax issue again. > > public string ColumnName(string columnName) { return columnName.ToLower(); > } > > Anyone know how to get this working normally again? Is this just part of > the DefaultNamingStrategy for SQL 2008 dialect now? > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > -- Fabio Maulo -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
