These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Error while generating MySQL queries
PostPosted: Thu Oct 26, 2006 10:56 am 
Newbie

Joined: Thu Oct 26, 2006 10:50 am
Posts: 1
Hi,

I'm currently trying to use NHibernate with a MySQL server. I have a table with fields named like MySQL keywords, and this seems to be a problem with the MySQL Dialect of NHibernate.

Example of a generated query:
> insert into compinfos (ClientId, Order, Value, Name) VALUES (10, 1, 'Test2', 'Test')

The correct SQL will be:
> insert into compinfos (`ClientId`, `Order`, `Value`, `Name`) VALUES (10, 1, 'Test2', 'Test')

Is this possible to specify prefix and sufix to use before and after the fields names? I think it will probably be better if NHibernate was using this kind of field encapsulation by default.

I know this is maybe a wrong idea to use MySQL keywords as fields names, but since it's not my database, I don't have the opportunity to change that to a safer naming.

Thank you for your help, and for the great work NHibernate is.

PS : Sorry for my english, I'm not very fluent.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.