>Justin,
>
>| Steve Muench wrote:
>|
>| > What is the prevailing wisdom / best-practice for how a finder method like:
>| >
>| >    findTopFiveSalespeople()
>| >
>| > On a Salesperson Entity Bean would be implemented?
>|
>| [snip]
>|
>| > Is this effectively impossible without resorting to proprietary
>| > vendor extension to support the ANSI SQL92 standard query language?
>|
>| Obviously in order for the finder to work in the first place you are
>| going to need to have the SalesPerson EB have their "sales figures" in
>| the first place. If you have that information, then the finder returns
>| the 5 in a Collection and you either sort it yourself in client code
>| (very, very simple if you write your own java.util.Comparator for a
>| List) or have a Stateless Session bean that does it for you. Pretty
>| trivial to do really isn't it.
>
>if I have 10,000 sales people likely their leads and closed sales
>are likely not modeled as part of the Salesperson EB itself, but
>instead as a related Lead and Sale EB. That means it might be
>easy to write a finder on the Sales EB -- findBySalesperson() --
>that, for any *given* salesperson, returns a collection of Sale
>EB's that they have made for a period. But this doesn't solve
>the business problem, right?
>
>To return the *Top Five* salespeople in my whole company
>for the last quarter, I need to:
>
>  -> Aggregate all of the individual sales by salesperson for a given period
>  -> Order (descending) by that aggregate per-salesperson total
>  -> Then return the first five in that ranked list of 10,000
>
snip

My answer to this woudl be that I would not use an Entity bean for a multi-row
finder because it' snot worthwhile performance-wise. SO I wouldn't do this in a
finder method. I'd have a session bean do the work.

Ken

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to