Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The answer is unfortunately easy. Subentities across physically different files and/or models is not supported. In the underlying data structure, Core Data will take all sub-entities and flatten them out to a single table. So if you have a Parent, ChildA, ChildB and ChildC each with 4 attributes, then you will end up with a single table with 16 columns.</p> <p>This is why sub-entities are not supported in the manner that you are attempting. Each model is a silo unto itself and can at most have weak references to objects in the other model(s).</p> <h2>Update</h2> <p>It is an issue of "not supported by design" as I explained above. What you are trying to do is not supported because of the way it is persisted in the underlying data structure. Creating sub-entities is not something you should be doing a lot of in the first place because it flattens your data model. </p> <p>Entity inheritance <strong>does not</strong> equal object inheritance. Your objects can inherit in any way, shape or form you want. Entity inheritance should be extremely rare and have a <em>very</em> good reason behind it. </p> <p>Solving parent child relationship issues is one of the few reasons to use entity inheritance. </p> <p>Trying to avoid duplication of columns is <strong>not</strong> a good reason.</p> <p>Since you cannot do parent/child relationships across models (and you do have more than one model even if they are being merged into one <em>instance</em> of the <code>NSManagedObjectModel</code>) it is unlikely to be a reason to do entity inheritance across models that can't be solved via a similar solution.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload