开发者

How do I fetch an object that is not part of an relationship

开发者 https://www.devze.com 2023-03-19 15:05 出处:网络
Lets say we have two entities Department and Employ开发者_如何学Pythonees with a one-to-many relationship.

Lets say we have two entities Department and Employ开发者_如何学Pythonees with a one-to-many relationship.

How do I fetch all employees who are not part of a selected Department?


Create a fetch request for the Employee entity and add a predicate that says "self.department NOT like %@", passing in the selected department as the parameter.

0

精彩评论

暂无评论...
验证码 换一张
取 消