http://fabiomaulo.blogspot.com/2009/06/auto-quote-tablecolumn-names.html

Tuna Toksöz
Eternal sunshine of the open source mind.

http://devlicio.us/blogs/tuna_toksoz
http://tunatoksoz.com
http://twitter.com/tehlike




On Fri, Jan 22, 2010 at 2:05 PM, DanV <[email protected]> wrote:

> Couldn't find it on NH reference but somewhere in NH in Action book it
> is specified that backticks should be used in this case.
> So in your mapping you should use smth like:
> table = "`tablename`"
> I guess this gives also portability over different DB engines.
>
>
> On Jan 21, 12:41 am, Mohamed Meligy <[email protected]> wrote:
> > This problem happened with my wife was working on some new website and
> was
> > using NHibernate for the first time (along with SQL Server 2008 Database,
> DB
> > first approach).
> > She was using HQL and sometimes IQueryOver API. Yes, this is from the
> trunk.
> >
> > She was mapping a table to a class that she named both "Group".
> Regardless
> > of how mistaken this is, it is interesting that when she maps it using
> >    table="Group"
> > Any query on this table fails with error "Invalid Syntax near 'Group'".
> >
> > She had to use instead:
> >    table="[Group]"
> > For the queries to work.
> >
> > *Now, my question is: shouldn't this kind of thing be handled
> automatically
> > by NHibernate? I assume by the dialect or something?*
> >
> > Regards,
> >
> > --
> > Mohamed Meligy
> > Senior Developer, Team Lead Backup (.Net Technologies - TDG -
> Applications)
> > Injazat Data Systems
> > P.O. Box: 8230 Abu Dhabi, UAE.
> >
> > Phone:  +971 2 6992700
> > Direct:   +971 2 4045385
> > Mobile:  +971 50 2623624, +971 55 2017 621
> >
> > E-mail: [email protected]
> > Weblog:http://weblogs.asp.net/meligy
>
> --
> 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.
>
>

-- 
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.

Reply via email to