]
loic descotte commented on HHH-5559:
------------------------------------
Thanks Erik for your reply.
"If orphanRemoval is true and an entity that is the target of the relationship is
removed from the
relationship (by setting the relationship to null), the remove operation will be applied
to the entity being
orphaned." --> That's what i want to make work, but i didn't see that is
was "by setting the relationship to null". So maybe that means that my use case
won't work... It's a bit strange, i believe that it's a more usual use case
than setting a relation to null...
Loic
JPA 2 orphanRemoval on OneToOne relation does not work properly
---------------------------------------------------------------
Key: HHH-5559
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5559
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.5.0.Beta-1, 3.5.0-Beta-2, 3.5.0-Beta-3, 3.5.0-Beta-4, 3.5.0-CR-1,
3.5.0-CR-2, 3.5.0-Final, 3.5.1, 3.5.2, 3.5.3, 3.5.4, 3.6.0.Beta1, 3.6.0.Beta2, 3.5.5,
3.6.0.Beta3, 3.6.0.Beta4
Environment: Hibernate 2.5 (tested with 3.5.4)
Reporter: loic descotte
I have an class A with a oneToRelation with a classe B :
@Entity
public class A{
@OneToOne(cascade = {CascadeType.ALL}, orphanRemoval=true)
B b;
...
}
If i do this :
A a = new A();
B b1 = new B();
a.setB(b1);
em.persist(a);
B b2 = new B();
a.setB(b2);
em.update(a);
As b1 become an orphan, Hibernate should remove it from the database. But it still
remains in the DB.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: