Re: finder or select methods - how to....
<[email protected]> Fri, 22 Mar 2002 10:17:54 -0500
| Newsgroups | gmane.comp.java.ejb.general,gmane.spam.detected |
|---|---|
| Message-ID | <[email protected]> |
------=____1016810274857_hFh(xCdvwK Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit this may be what you are asking for... in helper class: public static final String findByDescription = "string2 = ? AND integer2 = ? AND string4 = ?"; in Home Interface: java.util.Enumeration findByString1intger2string4(String string2, Integer integer2, String string4) throws java.rmi.RemoteException, javax.ejb.FinderException; Then just use the returned Enumeration. Hope this helps, Keith > > From: "niksa_os" <[email protected]> > Date: 2002/03/21 Thu AM 11:02:17 EST > To: <[email protected]> > Subject: [EJB-Developer] finder or select methods - how to.... > > 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?) > > ------------------------ 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/ ------=____1016810274857_hFh(xCdvwK Content-Type: text/html; name="reply" Content-Disposition: inline; filename="reply" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <META content="MSHTML 6.00.2713.1100" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff> <DIV><FONT face=Arial size=2>Hello everyone!</FONT></DIV> <DIV> </DIV> <DIV><FONT face=Arial size=2>........make finder method if I have in DB table - string1, string2,<BR>string3, integer1, integer2, string4 and finder or select method like this<BR>Collection findByDescription(String string1, String string2, String string3,<BR>Integer integer, Integer integer2, String string4,).</FONT></DIV> <DIV> </DIV> <DIV><FONT face=Arial size=2>But I want sometime finder method to find just with string2, integer2 and<BR>string4. I read about EJB QL and if I was read OK, there is no roblem if I<BR>don't put all parameters in EJB QL(?). Resault will be same if I have only<BR>findByDescription( String string2, Integer integer2, String string4,) with<BR>appurtenant EJB QL?</FONT></DIV> <DIV> </DIV> <DIV><FONT face=Arial size=2>But how to call finder method from client with for example string2, integer2<BR>and string4?<BR>findByDescription( ???, String string2, ???, ???, Integer integer2, String<BR>string4,).<BR>*Problem is that I have 25 fields in table and I hope I don't have to make<BR>finder for every field.</FONT></DIV> <DIV> </DIV> <DIV><FONT face=Arial size=2>-------------</FONT></DIV> <DIV> </DIV> <DIV><FONT face=Arial size=2>I try with null or "" but then I get empty Collection returned!<BR>I don't have any idea how to call such method and put only few parameters,<BR>others ignore.<BR>This is read-only, very quick, CMP EJB and I can't make X different methods<BR>combined of 25 fields.<BR>What EJB QL you suggest?<BR>(Maybe I use wrong QL?)</FONT></DIV> <br> <br> <tt> EJB-Developer group email addresses:<BR> Post message: [email protected]<BR> Subscribe: [email protected]<BR> Unsubscribe: [email protected]<BR> List owner: [email protected]<BR> <BR> Our other technical discussion groups:<BR> - For general Java (J2EE) questions/answers: <a href="http://groups.yahoo.com/group/Java_Developer">http://groups.yahoo.com/group/Java_Developer</a><BR> - For peer-to-peer software development discussion: <a href="http://groups.yahoo.com/group/P2P-Developer">http://groups.yahoo.com/group/P2P-Developer</a><BR> <BR> Web link to the EJB-Developer group:<BR> <a href="http://groups.yahoo.com/group/EJB-Developer">http://groups.yahoo.com/group/EJB-Developer</a><BR> <BR> 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.<BR> <BR> *** EJB-Developer - A free service brought to you by Democracy 2.0 (www.democracy2.org) ***</tt> <br> <br> <tt>Your use of Yahoo! Groups is subject to the <a href="http://docs.yahoo.com/info/terms/">Yahoo! Terms of Service</a>.</tt> </br> </BODY></HTML> ------=____1016810274857_hFh(xCdvwK--