automatically add necessary foreign key properties needed by nested objects