-->
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.  [ 3 posts ] 
Author Message
 Post subject: Table alias problem in generated SQL
PostPosted: Wed Jan 19, 2005 9:18 am 
Newbie

Joined: Thu Dec 16, 2004 9:00 am
Posts: 5
I am using Hibernate to persist objects where the class name is "Order". Hibernate generates SQL that cannot execute due to the use of "order" as an alias. "Order" being an SQL keyword, the following error is generated:

"BY expected after GROUP or ORDER: where [from com.x.y.z.businessModel.core.Order as [b]order[/b] where order.id=?]"

Is there any way of controlling the alias that hibernate uses, or forcing it to enclose the alias in quotations appropriate to the SQL dialect?

Thanks

Ian


Top
 Profile  
 
 Post subject: Re: Table alias problem in generated SQL
PostPosted: Wed Jan 19, 2005 9:19 am 
Newbie

Joined: Thu Dec 16, 2004 9:00 am
Posts: 5
Excuse the [\b] in the message above. To be clear: these are formatting additions and not part of the original error.


Top
 Profile  
 
 Post subject: Re: Table alias problem in generated SQL
PostPosted: Wed Jan 19, 2005 9:24 am 
Newbie

Joined: Thu Dec 16, 2004 9:00 am
Posts: 5
As usual, you find the answer after you post ...

I was getting this error from a call made from a hbm2java generated finder ... So it's a problem with the tool rather than Hibernate itself.

Since I am customising the generator code anyway, I can fix this locally, unless there is a better way?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.