-->
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.  [ 4 posts ] 
Author Message
 Post subject: "WARNING: Using non-qualified column reference"
PostPosted: Thu Apr 06, 2006 11:46 am 
Beginner
Beginner

Joined: Mon May 16, 2005 6:06 am
Posts: 20
Hi,
I'm using Hibernate 3.2 CR1. When executing a statement like

Code:
DELETE FROM test.entities.Invoice AS invoice WHERE invoice.number=10


the invoice gets deleted but the following warning is displayed in the logs:
Code:
06.04.2006 17:28:32 org.hibernate.hql.ast.tree.FromElementType toColumns
WARNING: Using non-qualified column reference [number -> ([number])]


How can I get rid of this warning?

I also tried the following with query with no succes:
Code:
DELETE FROM test.entities.Invoice WHERE number=10


Maybe the method org.hibernate.hql.ast.tree.FromElementType.toColumns(String tableAlias, String path, boolean inSelect, boolean forceAlias)
requires a change so that it also checks for HqlSqlTokenTypes.DELETE and not only for HqlSqlTokenTypes.SELECT?

Any help is appreciated.

Regards,
Johan


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 07, 2006 1:12 am 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
I take it that this is manual HQL (as opposite to sql-delete, or an sql-query).
If it's SQL, then put square brackets around the column name "number". If it's HQL, then I don't think that there's anything you can do, though you could try the square brackets to see if the HQL parser can deal with them.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 07, 2006 5:27 am 
Beginner
Beginner

Joined: Mon May 16, 2005 6:06 am
Posts: 20
Its HQL and I want to know if there is any good reason not to formulate a DELETE statement like this or if Hibernate should not show this Warning. In that case I'd file a bug report.

Johan


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 17, 2006 9:28 am 
Pro
Pro

Joined: Mon Jan 24, 2005 5:39 am
Posts: 216
Location: Germany
The problem is still there in hibernate 3.2.0 ga.
All of the following syntaxes give the same warning:

Code:
update myClassName set maxId = :nextEid
update myClassName c set c.maxId = :nextEid
update myClassName as c set c.maxId = :nextEid


The warning is:

Code:
WARN  - Using non-qualified column reference [maxId -> ([EIDMAX])]


In the first syntax the warning is ok.
But the second syntax is like the reference documentation
and should give no warning.
The problem is arising in class org.hibernate.hql.ast.tree.FromElementType
method:

Code:
   String[] toColumns(String tableAlias, String path, boolean inSelect, boolean forceAlias) {


In the line:

Code:
else if ( fromElement.getWalker().getStatementType() == HqlSqlTokenTypes.SELECT ) {



It fails for the statement types Update and Delete.

I didnt find a bug report for this.


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