-
1. Re: Why no data query abstraction in EJB?
juha Sep 30, 2002 1:18 PM (in response to davout)so how come finder methods aren't sufficient for returning lists of entities?
-
2. Re: Why no data query abstraction in EJB?
davout Sep 30, 2002 2:27 PM (in response to davout)Take a situation where I want to run a query against a customer database. Something like....
select customerID, customerName from customers
It does'nt make any sense to retrieve the entire Customer object. Also what happens if the customer object is a composite of things like...
Customer
|--- Customer Address Info
|--- Customer Order Info
|--- Customer Contacts
A finder would bring back huge amounts of data that simply isn't relevant.
I was sort of expecting EJB to include some of logical entity to data source mapping structure for all aspexcts of the data model - not just entity CRUD.
The few books I've read suggest using a DAO pattern for masking JDBC calls. Again this seems detached from the container based persistence. -
3. Re: Why no data query abstraction in EJB?
juha Sep 30, 2002 5:23 PM (in response to davout)See CMP2 spec and Dain's CMP2 docu, should answer your questions, e.g. how to configure the CMP engine to fetch just the information you require.
Also try the CMP forum, Dain will most likely explain how the persistence works in detail.
In short, no you don't have to fetch huge amounts of data as you describe.