Issue Type: Bug Bug
Affects Versions: 4.1.6
Assignee: Unassigned
Components: query-hql
Created: 23/Aug/12 6:26 AM
Description:

I've got an entity which does have a relation to itself (child - parent).
If i want to delete it, i must do this in the correct order or the constraint is violated.

HQL Query is:

2012-08-23 13:13:18,757 [qtp196024597-447] DEBUG org.hibernate.hql.internal.ast.QueryTranslatorImpl [QueryTranslatorImpl.java:265] - parse() - HQL: delete from de.test.entity.PageURL s where s.channel = :channel order by s.id desc

Result which is executed is:

2012-08-23 13:13:18,797 [qtp196024597-447] DEBUG org.hibernate.SQL [SqlStatementLogger.java:104] - delete from PageURL where channel_id=?

The order by clause is missing (AST Parser does seem to ignore it and does not even bail about, that it will be ignored) and the query fails, adding the missing part and do it via mysql commandline and things work like expected.

Environment: Hibernate 4.1.6, Mysql 5.5.x
Project: Hibernate ORM
Priority: Major Major
Reporter: Torsten Krah
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira