I agree, Entity bean finders are a very long-winded way of doing complicated
combinational queries. I usualy use a Session bean. On a previous project I
wrote BMP EBs and had a findByQuery method that took a String Where clause.

I don't understand why this should be though:

The container is able to hold entity beans in a temporary cache before
writing to the database: If, in a transaction, I insert 100 new EBs (some of
these might not be immediately created in the DB) and in the same
transaction do a find, the container will find not just the persisted
objects but also the EBs in the temporary cache.
So.. why can't finders be stacked.. i.e. use a findByName() method and
somehow apply findByAddress() to the resulting set. Just like in the
temporary cache with the first example.

Is there a logical flaw here or anybody know why it is not done like this?

Toby

-----Original Message-----
From: Kenneth D. Litwak [mailto:[EMAIL PROTECTED]]
Sent: Donnerstag, 28. Februar 2002 01:33
To: [EMAIL PROTECTED]
Subject: Re: How many Finders to I need for a search enginer?


  I'm generally not a fan o of finders, so my thoght would be to have a
session
bean that can take a collection of parms, parse that collection and use it
to
compose an SQL statement, and submit that, ignoring the Entity ean
altogether.
I think entity beans have good uses, but I don't think this is necessarily
one,.


  Ken Litwak

>Hi,
> I have an app that is going to have very intricate search capabilities. It
is
using CMP2.0. How would I implement finders in the system if I had for
instance
20 attributes for an entity, and the search could be any combination of the
20
attributes?(ie an item has price, age, weight and i want price >$20, age <50
years, weight == 10 pounds). Would I need to create a specific finder for
this
ie
>
>public Collection findByPriceANDAgeANDWeight(Float Price, int Age, int
Weight)
throws RemoteException, FinderException;
>
>and so on for every permutation (n^2 finders!?!?!?!) This seems a bit
ridiculous. Somebody please help, it almost makes me scared of using EJBs
for
this purpose, becuase I could more easily create a custom finder in a normal
JDBC client that appends SQL contraints like WHERE Price > 20. Is there a
way to
do this better in EJB (maybe a dynamic FindStatement?) similar to my JDBC
client
way?
>
>Warmest Regards,
>Eric Dunn
>[EMAIL PROTECTED]
>
>===========================================================================
>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".
>

===========================================================================
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".

===========================================================================
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