-->
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: 3.0.5 and Delete
PostPosted: Thu Jul 28, 2005 6:15 pm 
Newbie

Joined: Tue Feb 01, 2005 11:36 am
Posts: 5
I am attempting to perform a delete via createQuery like this:

createQuery(
"delete WebLogEntry where website.id = :id")
.setInteger("id", website.getId())
.executeUpdate();

However at runtme I am getting an exception:

JDBC exception on Hibernate data access: could not execute update query; nested exception is java.sql.SQLException: Column not found: WEBLOG_ENTRY_ID in statement [delete from weblog_entry where weblogentr0_.weblog_entry_id=? and status=?]

Looking at the sql that is being generated:

Hibernate: delete from weblog_entry where weblogentr0_.weblog_entry_id=? and status=?

It looks to be aa problem the table name referenced in the where clause is different that the table name in the from clause?

Am I doins something obviously stupid or is it an issue?


Top
 Profile  
 
 Post subject: Re: 3.0.5 and Delete
PostPosted: Thu Jul 28, 2005 6:39 pm 
Regular
Regular

Joined: Wed May 11, 2005 11:57 pm
Posts: 80
It would be very helpful if you could supply the mapping file for the class in question.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 9:58 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
post it to jira. looks like i missed some execution path in the parser to ensure that table aliases are not used in the delete/update statements.


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.