Update relations between entities