[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2791) HQL not cascading 'all-delete-orphan'

venkata sankara (JIRA) noreply at atlassian.com
Thu Aug 16 02:55:13 EDT 2007


HQL not cascading 'all-delete-orphan'
-------------------------------------

                 Key: HHH-2791
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2791
             Project: Hibernate3
          Issue Type: Bug
          Components: query-hql
    Affects Versions: 3.1.3
         Environment: Windows, HSQL-DB, Eclipse, HBMs, POJOs (No annotations)
            Reporter: venkata sankara
            Priority: Critical
         Attachments: HibernateParentChildTest.zip

I have a classes i) Parent  and ii) Child.

Both have only one field: String id;

Parent has been configured for one-to-many relationship with Child.

Entry in HBM:
	<set name="children" lazy="true" inverse="true" cascade="all-delete-orphan" >
		<key column="parent" />
		<one-to-many class="model.Child" />
	</set>

The following HQL doesn't cascade deletes:
delete Parent p where p.id = :parentId

However, the following code cascades deletes:

Parent p = session.get(Parent, "1");
session.delete(parent);

I have attached my eclipse project also. It is a small one with hardly 5 files.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list