Re: finder or select methods - how to....

Konstantin Ignatyev <[email protected]> Fri, 22 Mar 2002 07:44:03 -0800 (PST)
Newsgroups gmane.comp.java.ejb.general
Message-ID <[email protected]>
Very rough outline:

That is a common mistake to use EntityBeans methods to
find list of objects just for browse. It kills
performance and convenience.
Possible solution:
A Session bean should be aware of DB structure and
should take care of browsing and searching. When time
comes to CRUD (CreateReadUpdateDelete) for an object,
then use EntityB and its finder methods.  

In your case I would suggest to create SQL dynamically
on SessionBean depends on some meta-description(s). 

--- niksa_os <[email protected]> wrote:
> Hello everyone!
> 
> ........make finder method if I have in DB table -
> string1, string2,
> string3, integer1, integer2, string4 and finder or
> select method like this
> Collection findByDescription(String string1, String
> string2, String string3,
> Integer integer, Integer integer2, String string4,).
> 
> But I want sometime finder method to find just with
> string2, integer2 and
> string4. I read about EJB QL and if I was read OK,
> there is no roblem if I
> don't put all parameters in EJB QL(?). Resault will
> be same if I have only
> findByDescription( String string2, Integer integer2,
> String string4,) with
> appurtenant EJB QL?
> 
> But how to call finder method from client with for
> example string2, integer2
> and string4?
> findByDescription( ???, String string2, ???, ???,
> Integer integer2, String
> string4,).
> *Problem is that I have 25 fields in table and I
> hope I don't have to make
> finder for every field.
> 
> -------------
> 
> I try with null or "" but then I get empty
> Collection returned!
> I don't have any idea how to call such method and
> put only few parameters,
> others ignore.
> This is read-only, very quick, CMP EJB and I can't
> make X different methods
> combined of 25 fields.
> What EJB QL you suggest?
> (Maybe I use wrong QL?)
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Tiny Wireless Camera under $80!
Order Now! FREE VCR Commander!
Click Here - Only 1 Day Left!
http://us.click.yahoo.com/nuyOHD/7.PDAA/yigFAA/5cFolB/TM
---------------------------------------------------------------------~->

EJB-Developer group email addresses:
  Post message: [email protected]
  Subscribe:    [email protected]
  Unsubscribe:  [email protected]
  List owner:   [email protected]

Our other technical discussion groups:
 - For general Java (J2EE) questions/answers: http://groups.yahoo.com/group/Java_Developer
 - For peer-to-peer software development discussion: http://groups.yahoo.com/group/P2P-Developer

Web link to the EJB-Developer group:
  http://groups.yahoo.com/group/EJB-Developer

ATTENTION: You are receiving this message because you actively subscribed to the EJB-Developer technical discussion group on Yahoo! Groups.  All subscriptions come from Yahoo-verified email addresses and are logged; therefore subscriptions can be proved to any appropriate legal authority.  To unsubscribe, send a blank email from the email address receiving group messages to the "Unsubscribe" email address shown above.  If unsubscribing doesn't work, send a message concerning this problem to [email protected].  Only Yahoo! Groups is responsible for their own subscription services; the moderator will not perform these services at any time.

*** EJB-Developer - A free service brought to you by Democracy 2.0 (www.democracy2.org) *** 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/