-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to map table that is a keyword
PostPosted: Mon Sep 29, 2008 8:52 pm 
Newbie

Joined: Mon Sep 29, 2008 8:43 pm
Posts: 1
I am using NHibernate 2.0.0GA with SQL Server 2005 dialect.

How do I map table that is a keyword?
For example, if my table name is user or transaction
I can query like this:

select * from [user]
select * from [transaction]

since user and transaction are keywords.

If I map these tables using NHibernate and fetch the data, I got
"could not execute query" error. And when I see the indicated query statement, it's missing the square brackets. How do I get around it? (without renaming my table.)

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 30, 2008 2:09 am 
Regular
Regular

Joined: Tue Jul 29, 2008 3:30 am
Posts: 74
Just map it like this:
Code:
<class name="User" table="[User]">


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

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.