Hi Aravind, all,

In the definition of the finder, you should be able to specify an ORDER BY
clause.  This would be vendor dependant and from what I can tell, ORDER
BY -ing finder methods is not part of the EQL spec. in EJB 2.0. If not, Can
anybody tell me why?

So you may have a ejbFindByStatus() which returned and Ordered Collection,
which you could grab the one you want.

Alternatively execute the query in a SSB, and return the key and use the
ejbFindByPrimaryKey() method.

Using the Entity Bean could be argued to provide a standard approach to
manipulating the data of the system but there are also other factors to
influence the decision, such as:

-) Is the client just updating just a status field and no other fields in
the row? Is the client updating an "Entity" of the System or just setting a
general flag?
-) How many rows are in the table? May impact performance of your
ejbFind....() depending on the container/or mapping tool you're using.
-) Is the row used for anything else? If so then you may find yourself
writing many specific updateStatus() type functions that cannot be re-used
as much in the system as an Entity Bean could.

hope this helps,

regards,
-Rob



----- Original Message -----
From: Chaganthi, Madhusudan R. <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 23, 2000 12:47 AM
Subject: Re: EB Design Question


> Chuck
>
>
> What would be sql query which would accomplish the functionality of
> ejbFindNextWithStatus().
>
> I think that method definition is not quite possible with CMP.
>
> The second option seems to be good though its better achieved through a
> SSB+JDBC than a finder on an entity bean.
>
> Am I right ??
>
> Madhu
>
> -----Original Message-----
> From: Chuck Butkus [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 22, 2000 10:17 AM
> To: [EMAIL PROTECTED]
> Subject: Re: EB Design Question
>
>
> You should probably use an entity bean.
>
> You just need to create a finder method to get
> the next row with a certain status
> (e.g. ejbFindNextWithStatus()).
>
> Optionally you could create a finder method to
> get all of the rows with a certain status
> (e.g. ejbFindByStatus()) and then let the client
> choose which entity to update.
>
> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of Aravind Naidu
> Sent: Wednesday, June 21, 2000 5:03 PM
> To: [EMAIL PROTECTED]
> Subject: EB Design Question
>
>
> Hi,
> I have a design problem with Entity Beans.
>
> I have rows in a database that are flagged with say a status field. These
> rows get filled in nightly with a batch job.
>
> I need to extract via an Entity bean or SSB with JDBC, the NEXT record
with
> a particular status for the client to manipulate and update it's status.
> How do I do this ?
>
>
> -- Aravind
>
>
===========================================================================
> 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".
>

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