lets say i have Entity A and A Has List of B which is mark as OneToMany. do i have to fetch all of B items in order to add new B item to the list A has?
example:
@Entity
public class A {
@Id
Long id;
@OneToMany
List<B> bs;
}
do i have to fetch all of A.bs in order to add new item to bs ?
thanks
Alon
EDIT few more questions:
@German: interesting! few questions
what if the join between A and B is by Table C? do i get the same behavior?
why does the list make troubles?
what can i use instead of a list? Set?
if I persist A do i overwrite all the links for B?
what if the link is ManyToMany (using extra table)