-->
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: bug escaping keywords in hib 2.1.3
PostPosted: Wed May 19, 2004 1:13 pm 
Beginner
Beginner

Joined: Tue Oct 28, 2003 12:09 pm
Posts: 46
I just upgrade to hibernate 2.1.3 with sqlserver and started having a problem where hibernate didn't translate the HQL -> SQL properly when using the sqlserver keyword "user" in the HQL. Unfortunately, sqlserver being irritable, it didn't error...it just returned the user for the given rows of the user table ("dbo") instead of User objects.

Here's the log file.

Code:
13:07:24,279 DEBUG QueryTranslator:199 - HQL: select user from edu.academyart.model.User as user inner join user.coursePermissions as permissions where permissions.course = ?
13:07:24,279 DEBUG QueryTranslator:200 - SQL: select user as x0_0_ from users user0_ inner join rights courseperm1_ on user0_.id=courseperm1_.userid where (courseperm1_.courseId=? )
13:07:24,279 DEBUG BatcherImpl:196 - about to open: 0 open PreparedStatements, 0 open ResultSets
13:07:24,289 DEBUG SQL:237 - select user as x0_0_ from users user0_ inner join rights courseperm1_ on user0_.id=courseperm1_.userid where (courseperm1_.courseId=? )
13:07:24,289 DEBUG BatcherImpl:241 - preparing statement
13:07:24,289 DEBUG Loader:197 - processing result set
13:07:24,289 DEBUG Loader:405 - result row:
13:07:24,289 DEBUG Loader:405 - result row:
13:07:24,289 DEBUG Loader:405 - result row:
13:07:24,289 DEBUG Loader:405 - result row:
13:07:24,299 DEBUG Loader:405 - result row:
13:07:24,299 DEBUG Loader:405 - result row:
13:07:24,299 DEBUG Loader:405 - result row:
13:07:24,299 DEBUG Loader:405 - result row:
13:07:24,299 DEBUG Loader:405 - result row:
13:07:24,299 DEBUG Loader:405 - result row:
13:07:24,299 DEBUG Loader:405 - result row:
13:07:24,299 DEBUG Loader:405 - result row:
13:07:24,309 DEBUG Loader:405 - result row:
13:07:24,309 DEBUG Loader:226 - done processing result set (13 rows)
13:07:24,309 DEBUG BatcherImpl:203 - done closing: 0 open PreparedStatements, 0 open ResultSets    }


I'll send along my mapping files and such if you think they'll help.

I've worked around this by changing my query to not include the "user" keyword and all is well.

Let me know if you need something to help track this down.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 19, 2004 1:17 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
That is the result of an expansion on recognized keywords in the select clause and a "kind-of-a-bug". However there is currently no other solution than to rename the alias.


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.