[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2861) cascade="delete-orphan, all" is ignored

Rafael Chaves (JIRA) noreply at atlassian.com
Tue Sep 25 15:02:57 EDT 2007


cascade="delete-orphan,all" is ignored
--------------------------------------

                 Key: HHH-2861
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2861
             Project: Hibernate3
          Issue Type: Bug
          Components: core
    Affects Versions: 3.2.4.sp1
            Reporter: Rafael Chaves
            Priority: Trivial


In HbmBinder.java, the following code has a bug in which it will ignore the "delete-orphan" value if it appears at position 0:

	private static void validateCascade(Element node, String path) {
		String cascade = node.attributeValue("cascade");
		if ( cascade!=null && cascade.indexOf("delete-orphan")>0 ) {
			throw new MappingException("single-valued associations do not support orphan delete: " + path);
		}
	}

Instead, it should be:

		if ( cascade!=null && cascade.indexOf("delete-orphan")>=0 ) {

As a result, the user will not be warned if "delete-orphan,all" was specified in the cascade attribute, which is meaningless.

-- 
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