how to make relationships with a new entity?

by now, I use a maybe stupid way:

First, I have a parent_id.

1. save the entity ,

2. and then pick out the guid of this newest entity,

3. and then make relationship with the parent_id.

Is there a better way to do this?

Thanks.