[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-5529) Bulk delete on Entity with @ElementCollection ignores the @CollectionTable

Steve Ebersole (JIRA) noreply at atlassian.com
Thu Sep 2 23:06:18 EDT 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Ebersole updated HHH-5529:
--------------------------------

    Affects Version/s:     (was: 3.6.0.Beta3)
                           (was: 3.6.0.Beta2)
                           (was: 3.5.4)
                           (was: 3.5.3)
                           (was: 3.5.2)
                           (was: 3.5.0-Final)
                           (was: 3.5.1)
                           (was: 3.5.0-CR-1)
                           (was: 3.5.0-Beta-4)
                           (was: 3.5.0-CR-2)
                           (was: 3.5.0-Beta-3)
                           (was: 3.5.0-Beta-2)
                           (was: 3.6.0.Beta1)
                           (was: 3.5.0.Beta-1)
                       3.3.2
           Issue Type: New Feature  (was: Bug)

I really dont get how people extract "bug" from something that is explicitly documented to not happen that way.

> Bulk delete on Entity with @ElementCollection ignores the @CollectionTable
> --------------------------------------------------------------------------
>
>                 Key: HHH-5529
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5529
>             Project: Hibernate Core
>          Issue Type: New Feature
>          Components: entity-manager
>    Affects Versions: 3.3.2, 3.5.5, 3.6.0.Beta4
>         Environment: Hibernate 3.5.x, all database, all platforms.
>            Reporter: Pascal Thivent
>         Attachments: HHH-XXX.tar.gz
>
>
> I have an entity with a collection of basic elements mapped with @ElementCollection:
> {code}
> @Entity
> public class Foo {
>     @Id @GeneratedValue
>     private Long id;
>     @ElementCollection
>     @Column(name = "bar_column")
>     @CollectionTable(name = "Bar")
>     private Set<String> bars = new HashSet<String>();
>     public Long getId() { return id; }
>     public void setId(Long id) { this.id = id; }
>     public Set<String> getBars() { return bars; }
>     public void setBars(Set<String> bars) { this.bars = bars; }
> }
> {code}
> A bulk delete on this entity fails due to constraint violation on the collection table (Hibernate ignores the collection table).
> I don't think that the following cascading restriction from the JPA 2.0 specification applies:
> {quote}
> h3. 4.10 Bulk Update and Delete Operations
> ...
> A delete operation only applies to entities of the specified class and its subclasses. It does not cascade to related entities.
> {quote}
> In other words, Hibernate should handle the collection table as we have no way to bulk delete the basic elements from the collection table.
> I have attached a test case allowing to reproduce the issue.

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