|
Hi,
i have an entity, for example class B, with an @OneToMany-Association to an other entity, for example class A.
The cacadetyp is set to ALL.
@OneToMany(cascade = {CascadeType.ALL})
public List<B> getB() {
return b;
}
I have create a @PreUpdate callback method, in wich i change the associated elements.
@PreUpdate
public void adaptB() {
for (B element : b) {
element.setValue("test");
}
}
I would like to make the changes in the associated elements persistent. (merge cascading)
The problem is, that in every test case the changes of one element (the first in the associated list) are not make persistent. The changes of the other elements can be viewed in the database.
Is this a bug? Alternatives?
|