Re: How to debug fetch problem
Re: How to debug fetch problem
- Subject: Re: How to debug fetch problem
- From: Chuck Hill <email@hidden>
- Date: Tue, 10 Apr 2007 13:34:53 -0700
On Apr 10, 2007, at 1:04 PM, Janine Sisk wrote:
That was my original mistake, which I corrected after you pointed
it out yesterday :). Before that nothing was working, now the
String fields are working but the images are not.
I tried the WODebug magic trick and got this:
[2007-04-10 11:56:37 PDT] <WorkerThread0> [Thumbnail:WOImage] data
<== (com.webobjects.appserver._private.WOKeyValueAssociation: null)
[2007-04-10 11:56:37 PDT] <WorkerThread0> [Thumbnail:WOImage]
mimeType <== (class java.lang.String: "image/jpeg")
(lather, rinse, repeat for each image)
which doesn't tell me much, other than that no data is being
retrieved for the images.
Tread carefully, Grasshopper. Sometimes the answer does not present
itself as such. What is the binding for data? I recall it was
something like
aPanel.images.thumbnailImage
Null can mean any of:
1. aPanel is null
2. aPanel.images
3. aPanel.images.thumbnailImage
4. Can also mean some part of the path is misspelled, depending on
what kind of objects these are
They are there in the database; I can download them via FrontBase
Manager and open them in Preview. But there's some kind of
problem, obviously.
Yes, but let's determine the problem before the solution. Try adding
spurious bindings if you don't want to resort to log messages:
Image: WOImage {
data = aPanel.images.thumbnailImage;
mimeType = "image/jpeg";
foo = aPanel;
bar = aPanel.images;
WODebug = true;
}
I was trying to figure out how to write my own fetch spec with an
empty qualifier; all of the examples I can find include at least
one. But I got pulled off onto something else and haven't gotten
back to it yet.
Use null for an empty qualifier.
Chuck
On Apr 10, 2007, at 12:52 PM, Chuck Hill wrote:
If the Entity is named Panel, why does this say LicensePlate?
EOFetchSpecification fs =
EOFetchSpecification.fetchSpecificationNamed("getAllPanels",
"LicensePlate");
Chuck
On Apr 10, 2007, at 12:41 PM, Janine Sisk wrote:
I already ran EOGenerator once, but that was before I added the
fetch spec. So I just ran it again, but it said that all files
were identical and would not be overwritten.
I may well have messed up on creating this fetch spec; it wasn't
totally obvious what to do, which makes sense if the "power
users" don't use this feature. All I did was highlight the EO
called Panel and clicked the "new fetch spec" button. I don't
need a qualifier because I want it to grab all rows. I did tell
it to sort on the description field, and gave it a meaningful
name, but that was it.
Do I need to do anything else?
thanks,
janine
On Apr 10, 2007, at 6:34 AM, Mike Schrag wrote:
I don't do the saved fetch spec thing either, but I highly
recommend that if you do, you should EOGenerate them into your
class files so you don't have this problem again. I think
there's an example of that on the wikibook page about eogenerator.
ms
On Apr 9, 2007, at 10:33 PM, Janine Sisk wrote:
Ah... I tried that a while ago and got a different error, so I
thought it was wrong. But I have some printlns in there now
and I get my result.count() before the other error occurs, so
now I know you are correct. As if there was any doubt. :)
janine
On Apr 9, 2007, at 7:25 PM, Chuck Hill wrote:
I'm not really a "fetch spec in the model" kind of guy, but
the mismatch between LicensePlate and Panel seems suspicious.
The second parameter to that function is the name of the
entity where this fetch spec is declared. It seems to me like
this should be Panel not LicensePlate.
Chuck
On Apr 9, 2007, at 7:08 PM, Janine Sisk wrote:
I've just attempted my first fetch, and predictably it's not
working. This code:
EOEditingContext ec = session().defaultEditingContext();
EOFetchSpecification fs =
EOFetchSpecification.fetchSpecificationNamed("getAllPanels",
"LicensePlate");
NSArray result = ec.objectsWithFetchSpecification(fs);
results in an NPE on the last line.
I am not at all sure I created the fetch spec right; the
fspec file contains:
{
getAllPanels =
{
class = EOFetchSpecification;
entityName = Panel;
prefetchingRelationshipKeyPaths =
();
sortOrderings =
(
{
class = EOSortOrdering;
key = description;
selectorName = ascending;
}
);
};
}
How do I go about figuring out what I've done wrong?
thanks,
janine
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (Webobjects-
email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mdimension.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:
40furfly.net
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:
40global-village.net
This email sent to email@hidden
--
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
--
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden