且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

找不到ID为ID(155)的'AppBundleundEntity\User'类型的实体

更新时间:2023-11-16 14:38:58

弄清楚了!实际上,有一个启用的原则筛选器,它在每个sql查询中添加一个条件。当我得到一个组时,与之相关的用户不会从数据库中加载,只有其ID会与组实体一起加载。当我尝试访问ID以外的其他用户字段时,它将执行sql join查询。再次,原则过滤器甚至将条件添加到连接条件中,从而导致结果为空。

Figured it out!! Actually there is a an enabled doctrine filter that adds one condition in every sql query. When I get one group, the user being related to it is not loaded from the database, only its id is loaded with the group entity. When I try to access other user field than the id, it performs the sql join query. Again, the doctrine filter adds the condition even to the join condition, which leads to an empty result.

因此,错误消息显然具有误导性。

So the error message is clearly misleading.