finder or select methods - how to....

"niksa_os" <[email protected]> Thu, 21 Mar 2002 17:02:17 +0100
Newsgroups gmane.comp.java.ejb.general
Message-ID <01ad01c1d0f1$c89b4800$03211dc3@z>
------=_NextPart_000_01AA_01C1D0FA.27CAFB60
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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, integer=
2
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?)

------=_NextPart_000_01AA_01C1D0FA.27CAFB60
Content-Type: text/html; charset=US-ASCII
Content-Transfer-Encoding: 7bit

<!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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>-------------</FONT></DIV>
<DIV>&nbsp;</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>

<!-- |**|begin egp html banner|**| -->

<table border=0 cellspacing=0 cellpadding=2>
<tr bgcolor=#FFFFCC>
<td align=center><font size="-1" color=#003399><b>Yahoo! Groups Sponsor</b></font></td>
</tr>
<tr bgcolor=#FFFFFF>
<td align=center width=470><table border=0 cellpadding=0 cellspacing=0><tr><td align=center><font face=arial size=-2>ADVERTISEMENT</font><br><a href="http://rd.yahoo.com/M=215002.1818248.3328688.1261774/D=egroupweb/S=1705006905:HM/A=847665/R=0/*http://ads.x10.com/?bHlhaG9vbW9uc3RlcjcuZGF0=1016730452%3eM=215002.1818248.3328688.1261774/D=egroupweb/S=1705006905:HM/A=847665/R=1" target=_top><img src="http://ads.x10.com/?Z3lhaG9vbW9uc3RlcjcuZGF0=1016730452%3eM=215002.1818248.3328688.1261774/D=egroupweb/S=1705006905:HM/A=847665/R=2" alt="" width="300" height="250" border="0"></a></td></tr></table></td>
</tr>
<tr><td><img alt="" width=1 height=1 src="http://us.adserver.yahoo.com/l?M=215002.1818248.3328688.1261774/D=egroupmail/S=1705006905:HM/A=847665/rand=772960388"></td></tr>
</table>

<!-- |**|end egp html banner|**| -->


<br>
<tt>
EJB-Developer group email addresses:<BR>
&nbsp; Post message: [email protected]<BR>
&nbsp; Subscribe:&nbsp;&nbsp;&nbsp; [email protected]<BR>
&nbsp; Unsubscribe:&nbsp; [email protected]<BR>
&nbsp; List owner:&nbsp;&nbsp; [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>
&nbsp; <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.&nbsp; All subscriptions come from Yahoo-verified email addresses and are logged; therefore subscriptions can be proved to any appropriate legal authority.&nbsp; To unsubscribe, send a blank email from the email address receiving group messages to the &quot;Unsubscribe&quot; email address shown above.&nbsp; If unsubscribing doesn't work, send a message concerning this problem to [email protected].&nbsp; 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>

------=_NextPart_000_01AA_01C1D0FA.27CAFB60--