alexg wrote:
Hi pablius,
Thanks for the reply.
You are right, I want that everything will be updated.
But the question was why there is a need in a separate UPDATE statement. The B's row can include the A's ID that can be set by a single INSERT .
Thanks,
Alex
It's because your object B doesn't contain a reference back to A.
If B had a <many-to-one> relationship pointing back to the parent, the ID of A would be assigned to B when it was generated and stored in the database. Without the relationship, there is no place to put the ID on the B object.
I'm a little confused by your mapping to be honest. Assuming B_ID is the PK of B, how is it the KEY to the B collection on A ?
Read Section 22.2 of the 3.0.5 docs for more information.