Can any one tell me ? how do cascade.delete work?
Well if I have an Entity A and which have an Entity B
like
Code:
@Entity
Class A{
@OneToOne(fetch=FetchType.LAZY)
@Cascade( { CascadeType.SAVE_UPDATE, CascadeType.DELETE})
B b;
}
If I ask them to delete A, how will they delete?
Will they delete A then B, or remove Association with A and B Delete B and come back and delete A?
Well when i though both has there advantage and disadvantages
like if i delete A first I have to keep track of B, if there are n members all the n.
If the reverse is done then they have to remove association every time before deleting.