If you have the relationships setup between the BOs it will already handle this for you. SF BOs will manage the foreign key contraints for you, so even if in code, you try to save a child when the parent is a new record, it will first force the parent to save and then propogate the newly obtained PK to the children automatically.If you do not have a relationship setup, then you will need to do this manually.