• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Entity inheritance and sorting: Bug or my fault?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Entity inheritance and sorting: Bug or my fault?
      • From: Guido Neitzer <email@hidden>
    • Re: Entity inheritance and sorting: Bug or my fault?
      • From: Guido Neitzer <email@hidden>
References: 
 >Entity inheritance and sorting: Bug or my fault? (From: Guido Neitzer <email@hidden>)

  • Prev by Date: java.net.SocketException: broken pipe
  • Next by Date: Re: Entity inheritance and sorting: Bug or my fault?
  • Previous by thread: Entity inheritance and sorting: Bug or my fault?
  • Next by thread: Re: Entity inheritance and sorting: Bug or my fault?
  • Index(es):
    • Date
    • Thread