Can someone provide a quick clarification on the difference between finder and select methods and when to use one over the other. I'm using EJB2.0. Thank you.
posted 13 years ago
A finder method returns bean instance(s). A select method can return a value of any type. This is must useful for aggregate functions. Example - a select method could return a float representing the average order amount for a specific day... Previously this was only possible by doing a finder, and then iterating programatically from a session bean and computing the average. Summary - Allowing EJBQL in a select allows you to take advantage of the databases built in functionality when a bean instance isn't what you ultimately need.