advanced EOF: batch fetching relationship: can't fetch certain relationships
advanced EOF: batch fetching relationship: can't fetch certain relationships
- Subject: advanced EOF: batch fetching relationship: can't fetch certain relationships
- From: Jonathan Rochkind <email@hidden>
- Date: Tue, 17 Feb 2004 19:57:24 -0600
Okay, more fun with batchFetchRelationship, trying to optimize some
code. [I have a little bit more insight on the last question after
experimenting; this is a new one].
I have a bunch of objects (call em Departments), with a to-many
relationship (call it toEmployees). (It's actually a flattened
many-to-many, but I don't think that effects the below description).
EOF, in batch fetching a to-many relationship, whether through a
numerical setting in EOModeler, or whether through
EODatabaseContext.batchFetchRelationship.... in either case, it
insists on using a "SELECT DISTINCT" query on the destination entity.
Alas, my database, SQL Server 7, won't allow a "SELECT DISTINCT" on a
table that includes columns of types 'text'. And the Employee table
does.
Prefetching relationship key paths ALSO uses a "SELECT DISTINCT", so
won't work with this relationship either. Whether batch
fetching/faulting, whether prefetching----I can't do it, I get an
exception from my db "Can't select distinct on a table with a 'text'
type column ".
Argh. So... what the heck can I do to efficiently fetch these to-many
arrays? I've got a list of potentially dozens (or even 100 or 200)
Departments, and I'm going to have to display them with their
employees. I don't want a seperate trip to the db to resolve each
Departments toEmployees relationship. Can anyone think of any
alternatives at all, anything I can do to solve this problem?
--Jonathan
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.