id needs to be assigned before relations are initialized for collections