Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在过去的 4 个小时里,这个错误一直困扰着我。
此外,当我交换它并首先获取用户数据然后是消息数据时......User.name会显示,但Message.message不会。所以数据肯定会进入,但它们之间的关系似乎被打破了。
User.name
Message.message
首先,+1 表示您为说明您的问题而创建的图像所做的努力。
问题的原因是您从未将用户分配给消息(反之亦然)。
尝试
message.fetchUser = user;
或者
user.fetchMessage = message;
然后保存您的上下文并执行获取请求。
正如罗格所说,我需要将用户分配给消息(反之亦然)。基本上,我将这段代码放在输入数据的位置之后。
messageDetails.fetchUser = userDetails