-->
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: Deleting entities with the Query API and MySQL 4.1.9
PostPosted: Mon Apr 04, 2005 5:26 am 
Newbie

Joined: Mon Apr 04, 2005 5:08 am
Posts: 2
Hi,

I am using Hibernate3 and MySQL 4.1.9 Professional. I wanted to delete an entity with the Query API:

Query q = sessionFactory.createQuery("delete Entity where id=?");
...
return q.executeUpdate();

However, when executing this, I get a syntax error from MySQL. I pasted the generated SQL and used in another database client and still got the same error. It seems that MySQL 4.1.9 does not allow table aliases in the DELETE clause.
The generated SQL looks like this: delete from Entity entity0_ where id=?
It seems MySQL does not support the alias for the table name. I configured the session factory to use org.hibernate.dialect.MySQLDialect.
How can I disable the generation of the dialect?

Thanks,
Cristian


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 04, 2005 12:16 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
i think steve talked about this, did you try with last CVS version?

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


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.