Re: Fetching from related object
Re: Fetching from related object
- Subject: Re: Fetching from related object
- From: Arturo PĂ©rez <email@hidden>
- Date: Mon, 26 Apr 2004 16:04:22 -0400
What you're seeing doesn't make a lot of sense to me.
On Apr 26, 2004, at 2:37 PM, Randall Perry wrote:
on 4/26/04 10:20 AM, Arturo Pirez at email@hidden wrote:
Do you know how to turn on SQL logging? Could you do that and take a
look at the sql being generated?
Also, are you using the pgSQL plug-in?
----
I'm using PostgresqlPlugin and eomodeler plugin from hexdreams.
[2004-04-26 14:17:22 EDT] <WorkerThread1> evaluateExpression:
<com.webobjects.jdbcadaptor.PostgresqlExpression: "SELECT t0.comments,
t0.contact, t0.cust, t0.cust_no, t0.division, t0.email, t0.enter_date,
t0.filecode, t0.hold, t0.mod_date, RTRIM(t0.password), t0.profit,
t0.profit_div, t0.user_name, t0.vendor FROM public.cust_view t0 WHERE
(t0.user_name = ? AND t0.password = ?)" withBindings:
1:"acme"(userName),
2:"xxxxxxx"(password)>
If I force the fetch I get an additional query on log:
[2004-04-26 14:27:00 EDT] <WorkerThread1> evaluateExpression:
<com.webobjects.jdbcadaptor.PostgresqlExpression: "SELECT t0.comments,
t0.cust_no, t0.date_time, t0.division, t0.errors, t0.filekey,
t0.filename,
t0.filesize, t0.linecount, t0.log_no, t0.status, RTRIM(t0.type),
t0.upload_time, t0.vendor FROM public.log t0, public.cust_view T1 WHERE
(T1.password = ? AND T1.user_name = ?) AND t0.cust_no = T1.cust_no"
withBindings: 1:"xxxxxxx"(password), 2:"acme"(userName)>
I would have thought (without the prefetching) that you'd get the first
query then a query like
[2004-04-26 14:27:00 EDT] <WorkerThread1> evaluateExpression:
<com.webobjects.jdbcadaptor.PostgresqlExpression: "SELECT t0.comments,
t0.cust_no, t0.date_time, t0.division, t0.errors, t0.filekey,
t0.filename,
t0.filesize, t0.linecount, t0.log_no, t0.status, RTRIM(t0.type),
t0.upload_time, t0.vendor FROM public.log t0, public.cust_view T1 WHERE
(T1.cust_no = ?) AND t0.cust_no = T1.cust_no"
withBindings: 1:89(cust_no)> // the 89 is a made up cust_no
when you hit the line
logInfo = (NSArray)custInfo.valueForKey("logs");
I wonder if you're running into data conversion issues. Are the
cust_no defined exactly the same type in both tables?
BTW, in a relatively unrelated aside, did you look at
EOUtilities.objectMatchingValues. It's a bit easier then writing that
fetchspec.
----
WO in philadelphia - wanna cheesesteak with that?
Please visit webobjects.meetup.com.
_______________________________________________
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.