I would like to know what's the right way to remove a child from a one-to-many relation within GWT using the RequestFactory.
My GWT application with an Entity called Product and that product has a one-to-many relation to an Expert:
@Entity
public class Product {
...
OneToMany(mappedBy="product", orphanRemoval=true,
cascade={CascadeType.DETACH,CascadeType.MERGE,CascadeType.PERSIST,CascadeType.REFRESH},fetch=FetchType.EAGER)
Set<Expert> experts = new HashSet<Expert>();
...
}
@Entity(name = "EXPERT")
public class Expert {
...
@ManyToOne(optional=false)
Product product;
...
}
I have a user-interface where you can change some values of Product, but also a window where experts can be added or removed. Adding a Expert goes well, but how do I remove an expert? And what administration must I do on the client and server side?
I have already an opened productRequest going on.
I would appreciate all the help!