Re: Java Client RawRows Query
Re: Java Client RawRows Query
- Subject: Re: Java Client RawRows Query
- From: Neil MacLennan <email@hidden>
- Date: Tue, 29 Apr 2008 01:32:18 +0100
Hi Florijan, David,
Thanks for the welcome to the WOJC club. I'm normally a webapp person,
but a client-side app suits well for hooking up a barcode scanner and
processing the results.
Now, what this is going to do is retrieve all the EOs from the server
then iterate through them on the client and sum the "attributeToSum"
and return that value. So this one command does a _lot_ of EO work
(ain't WO great?). If there are a lot of EOs in the relationship and
you don't need all of them on the client for other things, then you
should probably perform this in the server-side class instead of the
client-side one. The way I normally do this is using regular stateful
Remote Method Invocation that is built into every EO.
Are you absolutely sure you need to go to the DB yourself? Why can't
you use WO to manage the fetching of the DB records?
I realise that WO would quite happily fetch my data (and thanks for
the tip on one-step addition) but I'm going to poll this statistic
once a minute and I didn't want to fetch up to 10,000 EOs just to add
up an integer. A SQL shortcut seemed appropriate, taking account all
of the technologies at my disposal, I felt there was no need to
doggedly stick to EOs for everything.
Though I must say that "SELECT sum(*) AS overallTotal FROM tickets" is
somewhat confusing to me, but then again my SQL is rusty... Neil,
what exactly are you summing up?
Sorry, that should have read "SELECT sum(qty) AS overallTotal FROM
tickets", that is, I want to know how many tickets I have sold across
all orders.
It seems that RMI is the way to go, especially since you've pointed
out that it's built-in to EOs. Since I just need this result as a read-
only property then stateless RMI might be appropriate. I'll study
Florijan's example on RMI and come back if I get stuck.
Thx
.neilmac
_______________________________________________
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