Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 93885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:24:53+00:00 2026-05-10T23:24:53+00:00

Say I have entities organized in a hierarchy with Parent being the root entity

  • 0

Say I have entities organized in a hierarchy with Parent being the root entity and Child being a subclass of Parent. I’d like to setup an NSArrayController to fetch only entities of Parent, but not Child.

If you set the Entity Name of the array controller in Interface Builder to Parent, it fetches all Parent and Child entities. I originally tried setting the array controller’s fetch predicate in Interface Builder to:

entity.name == 'Parent' 

This worked for an XML store, but when I switched to a SQLite store, it no longer worked. I get the following error:

keypath entity.name not found in entity <NSSQLEntity xxx> 

As a work around, I am setting up a filter predicate (with the same entity.name predicate as above) in my awakeFromNib to filter only Parent entities. Apparently, that predicate is valid once the entities are in memory, but you can’t use it in a SQL-backed fetch predicate.

Is there a way to fetch only Parent entities, but not Child entities using a fetch predicate that works with a SQLite store? It seems wasteful to pull in entities that you’re only going to ignore with the filter predicate.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T23:24:53+00:00Added an answer on May 10, 2026 at 11:24 pm

    I tried using includesSubentities, but it ended up not working completely. It turns out changes to subentities cause the array controller’s content to get updated without doing a fetch if you have ‘automatically prepares content’ set to ‘Yes’, thus bypassing the custom fetch predicate. The backtrace shows setContent: being called in response to MOC notifications.

    The only way I’ve found to do this reliably is to use a filter predicate.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have an entity called Request that has collections of child entities like
Say, we have 2 entities : Parents and children . When a parent is
Say, I have following entities: @Entity public class A { @Id @GeneratedValue private Long
Let's say you have a Classroom entity with an collection of Student entities. What
Say I have a list of EF entity names like: List<string> entityNames = new
hey guys, say I have Entities and mappings like this: public class Episode {
If I have entities like: @Entity public class Person { public String name; @OneToMany
Say I have a User and UserProfile entities. I'd like to be able to
Lets say I have entities Article, Page and Category. I want entity Article to
If I have entities that inherit from a base entity (say Widgets, Gadgets, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.