]
Hardy Ferentschik updated HHH-4626:
-----------------------------------
Fix Version/s: 3.6
OneToMany cascadeType.ALL change collection and merge - does not
remove entities
---------------------------------------------------------------------------------
Key: HHH-4626
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4626
Project: Hibernate Core
Issue Type: Bug
Components: entity-manager
Affects Versions: 3.3.1
Environment: JBoss 5.1.0.GA, FC 10, Java 1.6
Reporter: Dave
Assignee: Hardy Ferentschik
Fix For: 3.6
public Class Foo {
@OneToMany(fetch=FetchType.LAZY, cascade={CascadeType.ALL}, mappedBy="foo")
public List<Bar> getBars() {
return bars;
}
}
// aFoo is persited
Foo aFoo = ...
aFoo.getBars().remove(0); // remove the first
aFoo.getBars().add(aBar); // add new one
em.merge(aFoo);
For cascade={CascadeType.ALL}, it works for creating/deleting aFoo.
For merge, the new aBar is created, but the bar that was removed from collection are not
deleted from persistence.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: