Reputation: 75
I have entityA
and entityB
that have a one-one relationship between them (entityA.a = entityB
).
My question is: if I set entityA.a = entityB
, then insert entityA
, will entityB
automatically be inserted?
I think it should be, but it looks like it's not.
Does that mean I should insert entityB
myself?
By the way, I know I should call insert
myself for a one-to-many relationship.
Upvotes: 2
Views: 1295
Reputation: 2430
No, it won't be inserted. A relation is a link between two existing entities, you should first insert both entities and set de relation after.
Upvotes: 1