// create new objects and insert them into editing context
EOEditingContext editingContext = editingContext();
// generate fee and rental and insert it into editing context
Fee fee = new Fee();
Rental rental = new Rental();
editingContext.insertObject(fee);
editingContext.insertObject(rental);
// manipulate relationships after inserting objects
rental.addObjectToBothSidesOfRelationshipWithKey(unit, Rental.UnitKey);
rental.addObjectToBothSidesOfRelationshipWithKey(fee, Rental.FeesKey);
addObjectToBothSidesOfRelationshipWithKey(rental, RentalsKey);