Hi Shiv,

YES - Exactly. The Inprise Application Server 4.0 supports the In clause
along with much more in their built-in CMP engine saving you the bother of
having to go off and buy something to beef up your ejb server. You can also
use TopLink with IAS 4.0 if you can dream up more complexity.

William Louth

Examples from old IAS projects:

<finder>
<method-signature>findByCurrencyTypeAndDate(int oid, java.sql.Date
date)</method-signature>
where-clause>(currency_type_id, date_active) in (select currency_type_id,
max(date_active) from core.exchange_rate where  (:date >= date_active) and
(currency_type_id = :oid) </where-clause>
</finder>

<finder>
<method-signature>findExpansions(com.aucs.core.server.beans.entity.network.S
witch s, int origin, String suffix)</method-signature>
<where-clause> (switch_id = :s[ejb/switch]) and (b_origin = :origin)  and
(length(origin_suffix) = decode(:suffix, null, 0, length(:suffix)) + 1) and
(origin_suffix like ( :suffix || '%' )) and (execution_id = (select
object_id from execution where end_time = (select max(end_time) from
execution where (status = 4) and (completion_status=11)))) order by
b_origin</where-clause>
</finder>

> -----Original Message-----
> From: Tom Larson [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, May 04, 2000 8:09 PM
> To:   [EMAIL PROTECTED]
> Subject:      Re: Does finder support IN clause
>
> Not exactly.
>
> However, we've used the TopLink CMP container for WebLogic 4.5.1.  (Their
> WLS
> 5.1 product is in beta right now)  TopLink does support constructing IN()
> clauses from input Vectors -- with one important limitation: It doesn't
> work
> with bind variables.  In other words, the desired JDBC SQL should look
> something
> like:
>
> /* ?'s representing bind variables and allowing
>    SQL statement reuse at the DB level */
> SELECT ...
> FROM ...
> WHERE columnA in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
>
> assuming you want SQL statement reuse (and for Oracle at least, you do --
> trust
> me)
> What TopLink can produce is:
>
> /* hard-coded values for the IN() restriction */
> SELECT ...
> FROM ...
> WHERE columnA in (1, 3, 8, 12, 87, 105)
>
> We managed to work around this limitation by using lots of "OR"s.  The
> resulting
> SQL was quite ugly, but much more efficient.
>
> Tom Larson
> Capital One Services, Inc.
> [EMAIL PROTECTED]
>
> -----Original Message-----
> From: Shiv Kumar <[EMAIL PROTECTED]>
> Sent: Thursday, May 04, 2000 8:14 PM
> To: [EMAIL PROTECTED]
> Subject: Does finder support IN clause
>
>
> Hi all
>
> Does any other Application Server provide such a feature? Read on..
>
> I am using Weblogic 5.1 and struggling to write a finder method for a CMP
> bean
> which can use the SQL 'IN' clause. For example, I want something like this
> :-
>
> public Enumeration findByAandBs(A a, B[] b) {
>   // this finder should translate to
>   // select * from t where t.a = a and t.b IN (b[0], b[1], b[2],....
> b[n]);
> }
>
> The weblogic WLQL operator list does not include the 'IN' operator. Has
> anyone
> else in this list faced the same problem?
>
> Thanks.
> --
> shiv
> [EMAIL PROTECTED]
>
>
>
> --
> shiv
> [EMAIL PROTECTED]
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Talk to your friends online with Yahoo! Messenger.
> http://im.yahoo.com
>
> ==========================================================================
> =
> 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".


***********************************************************************
Bear Stearns is not responsible for any recommendation, solicitation,
offer or agreement or any information about any transaction, customer
account or account activity contained in this communication.
***********************************************************************

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