Hi Frank,

On Sep 27, 2006, at 11:59 PM, Frank Stock wrote:

I have made a construction with EOQualifier here is my QualifierString:

(languagesavedtemplate.language=%@) and ((name caseInsensitiveLike % @) OR (languagesavedtemplate.savedtemplatedescription caseInsensitiveLike %@)) AND
(usersavedtemplate.user=%@) AND
(usersavedtemplate.user.usernode.node=savedtemplatenode.node) <-------------

and this is the SQL-statment that is generated:

"SELECT t0."approvaluser_id", t0."ctime", t0."mtime", t0."name", t0."ordercomment", t0."orderref", t0."previewfile", t0."savedtemplate_id", t0."status", t0."template_id", t0."thumb", t0."user_id" FROM "savedtemplate" t0, "language_savedtemplate" T2, "user_savedtemplate" T1
WHERE ((1=1) <-----------------
AND T1."user_id" = 1000000 AND (t0."name" LIKE '%test%' COLLATE INFORMATION_SCHEMA.CASE_INSENSITIVE OR T2."savedtemplatedescription" LIKE '%test%' COLLATE INFORMATION_SCHEMA.CASE_INSENSITIVE) AND T2."language_id" = 1000000) AND t0."savedtemplate_id" = T2."savetemplate_id" AND t0."savedtemplate_id" = T1."savedtemplate_id" ORDER BY t0."name" COLLATE INFORMATION_SCHEMA.CASE_INSENSITIVE ASC"

Why is this not working and is:
                        
(usersavedtemplate.user.usernode.node=savedtemplatenode.node)
generating:
                        (1=1)
Is it possible to work with relations that way?

I have seen that before, but I don't recall the cause. It _should_ work, if (usersavedtemplate.user.usernode.node=savedtemplatenode.node) is getting translated into a EOKeyComparisonQualifier. One possibility is that your model is not as you think it should be. It may be that EOF is determining that both sides of (usersavedtemplate.user.usernode.node=savedtemplatenode.node) refer to the same column in the same row that it is optimizing it to 1==1.

Chuck

--

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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to