Hi Jon,

On Sep 30, 2009, at 1:10 PM, Jon Nolan wrote:

I have something like this modeled in single-table inheritance:

AbstractResource
  Resource1
  Resource2
  ...
  ResourceN

AbstractResource is marked as abstract and a class attribute named "resourceType" handles the restricting qualifier.

If I execute this:

NSArray<AbstractResource> resources = AbstractResource.fetchAllAbstractResources(ec());

I get this:

java.lang.IllegalStateException: Unable to determine subentity of 'AbstractResource' for row: { ...bunch of attributes... }. Check that the attribute 'resourceType' is marked as a class property in the EOModel and that the value satisfies some subentity's restricting qualifier.

The attribute _is_ marked as a class property and the value _does_ satisfy some subentity's restricting qualifier.

Are you sure it is marked as a class property in every single entity? Is there one entity that has a subtle difference in the modeling of this?

This is beyond doubt. I read somewhere once that there's a fluky thing wherein the order of the entities alphabetically within the model matters. Hence my parent entity begins with "A" and is the very first entity in my model. Doesn't help.

I don't recall that.


I have had it working for weeks by making AbstractResource non- abstract and that gets me past the throw but it causes me problems in other areas (i.e. a fetchRequiredXXX against Resource returns two copies.) I'm coming back now to do this "the right way" and make single-table inheritance with an abstract parent work as I imagine it should.


Adding a unique restricting qualifier to the abstract entity should avoid the duplicates. I don't recall running into this.

Chuck


--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to