My problem is that I have an object A which contains a list of B Objects
@Entity
class A {
@OneToMany(cascade={CascadeType.MERGE})
List<B> list;
}
When I make a "merge" of an object A and then call "flush" inside a stateless EJB method
em.merge(a); //a is of class A
em.flush(); //doesn't flush "list"
it actually doesn't work. the ids of B objects of "list" are not setted.
But persisting and the flushing works
em.persist(a);
em.flush(); // it works!
The ids of B object of "list" are setted.
I'm using EclipseLink. Does anybody knows what could be happen?