-->
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: Wrong SQL column names in 3.1
PostPosted: Tue Dec 20, 2005 11:06 pm 
Newbie

Joined: Wed Jun 29, 2005 8:42 pm
Posts: 3
There seems to be a bug in bulk update/delete SQL generation in Hibernate 3.1. HQL statements that worked in 3.0 no longer work. The problem seems to be that in some cases HQL column names are not converted to SQL column names. This, among others, breaks JBPM.

Take this query for example (from JBPM's SchedulerSession.java):

Code:
  private static final String deleteTimersQuery =
    "delete from org.jbpm.scheduler.exe.Timer " +
    "where name = :timerName" +
    "  and token = :token";


This generates the following SQL:

Code:
delete from JBPM_TIMER where NAME_=? and token=?


As you can see, "name" was converted correctly into "NAME_", while "token" was left as it was, instead of being coverted into "TOKEN_". This generates a "column does not exist" error.


Column name translation seems to work if you use aliases in HQL, like this (this is the above HQL rewritten):

Code:
delete from Timer [b]t[/b] where [b]t.[/b]name = :timerName and [b]t.[/b]token = :token


I already rewrote all of my HQL, but I don't want to rewrite JBPM as well, so we'll have to go back to 3.0 until this problem is fixed.

FYI: We're using PostgreSQL 8, maybe this bug is specific to its dialect.

Regards,
Jaka


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 20, 2005 11:10 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
No there was a bug in 3.1 relating to trying to reference an association property without a qualifying alias. This is already fixed in CVS and will be included in 3.1.1


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.