Re: Entity inheritance and sorting: Bug or my fault?
Re: Entity inheritance and sorting: Bug or my fault?
- Subject: Re: Entity inheritance and sorting: Bug or my fault?
- From: Ken Anderson <email@hidden>
- Date: Sun, 09 Jul 2006 10:55:16 -0400
SortOrderings on fetch specs for things not in the database will not
work. You should fetch them first, then sort them using
EOSortOrdering.sortedArrayUsingKeyOrderArray. Are you SURE it's
working for Contact? Is there a field in the database called 'name'
that maybe your entity doesn't use and it just happens to work?
On Jul 9, 2006, at 10:45 AM, Guido Neitzer wrote:
Hi.
I found a small problem with entity inheritance, which I don't
understand. I hope my explanation is not too bad because I hope to
get some enlightening comments here ...
I have a base component called "EmbeddedList" that takes an entity
name and an initial fetch specification and uses this to build a
displayGroup of the objects in the database.
Now, I have the following inheritance in my model:
Contact
- Company
- Person
- InternalUser
So, everything inherits from Contact, but InternalUser is a bit
deeper, it inherits from Person.
Now I have two different list components, both extending
EmbeddedList. The first ("ContactList") uses "Contact" as its
entityName, the second ("UserList") uses "InternalUser" as its
entityName.
The fetch specification for both is exactly the same and uses a
sortOrdering which orders not on an attribute but on a calculated
value called "name". Each Subentity has a method "public String name
()" which returns some appropriate value.
When I use this fetch specification now on my first list with the
entity "Contact" it works just fine. When I use it on the second
list with the entity "InternalUser" it fails because it tries to
generate a sql order by clause for "name" and this fails (as
expected).
Why is this the case? Okay, I can see that it might not be a good
idea to set a sort ordering on a "non attribute key" in the fetch
spec, but why does it work in one case and fails to work in the other?
cug
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40anderhome.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden