Re: EJB finder methods.

2000-08-29 Thread James Ho

Hi Paul

I am a newbie in EJB...so don't know if this will really helps..

I guess u implement the finder methods in the bean class?  and also modify
the Home interface file to add that method in.

Regards, James


 Where do I specify my own finder methods in my entity bean.
 _
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

 Share information about yourself, create your own public profile at
 http://profiles.msn.com.





RE: EJB finder methods.

2000-08-29 Thread Rick Bos

For Container Managed Persistence beans, you just add the method to the Home
interface:

public Collection findByField1 ( String field1 ) throws FinderException ,
RemoteException ;

The container will automatically write the finder method for you.

For Bean Managed Persistence beans, you put the same method in the Home
interface,
but you must write your own finder method in the EJB class:

public Collection ejbFindByField1( String field1 ) {

 ...  SQL statements to find Collection 
return Collection.

}

 -Original Message-
 From: James Ho [SMTP:[EMAIL PROTECTED]]
 Sent: August 29, 2000 12:18 PM
 To:   Orion-Interest
 Subject:  Re: EJB finder methods.
 
 Hi Paul
 
 I am a newbie in EJB...so don't know if this will really helps..
 
 I guess u implement the finder methods in the bean class?  and also modify
 the Home interface file to add that method in.
 
 Regards, James
 
 
  Where do I specify my own finder methods in my entity bean.
 
 _
  Get Your Private, Free E-mail from MSN Hotmail at
 http://www.hotmail.com.
 
  Share information about yourself, create your own public profile at
  http://profiles.msn.com.
 




RE: EJB finder methods.

2000-08-29 Thread Roman Kagan

First of all implement the Entity Bean with Container Managed Persistence.
In that case you'll need to have finder method declared in Home interface
and
implemented in Primary Key class.  YOU WILL NOT HAVE finder METHOD IN EJB
CLASS for CMP.  It will be written by the container at the deployment time!

Check page 89 in "Enterprise Java Beans" 2nd edition by Richard
Monson-Haefel


-
Roman Kagan 5155 Bantry Dr
Chief Architect W. Bloomfield, MI 48322
SoftFinity Corp.phone (248) 227-1220
[EMAIL PROTECTED]   fax (810) 958-5148
-
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of James Ho
Sent: Tuesday, August 29, 2000 12:18 PM
To: Orion-Interest
Subject: Re: EJB finder methods.


Hi Paul

I am a newbie in EJB...so don't know if this will really helps..

I guess u implement the finder methods in the bean class?  and also modify
the Home interface file to add that method in.

Regards, James


 Where do I specify my own finder methods in my entity bean.
 _
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

 Share information about yourself, create your own public profile at
 http://profiles.msn.com.








RE: EJB finder methods.

2000-08-29 Thread Jeremy Cowgar

In a finder method, how do you automatically have a custom SQL
statement...For instance:

CREATE TABLE names (
nameID int,
fname char(20),
lname char(20),
city char(40))

Collection findByCity(String sCity);

I would like to set an ORDER BY lname in my finder method...I know it can be
done in the application deployment, but what about if I ship my EJB to other
companies, do I have to have them edit all the application deployment .xml
files to add custom finders?

Thanks!

Jeremy - [EMAIL PROTECTED]
Christian Brotherhood Newsletter

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Roman Kagan
Sent: Tuesday, August 29, 2000 8:22 AM
To: Orion-Interest
Subject: RE: EJB finder methods.
Importance: High


First of all implement the Entity Bean with Container Managed Persistence.
In that case you'll need to have finder method declared in Home interface
and
implemented in Primary Key class.  YOU WILL NOT HAVE finder METHOD IN EJB
CLASS for CMP.  It will be written by the container at the deployment time!

Check page 89 in "Enterprise Java Beans" 2nd edition by Richard
Monson-Haefel


-
Roman Kagan 5155 Bantry Dr
Chief Architect W. Bloomfield, MI 48322
SoftFinity Corp.phone (248) 227-1220
[EMAIL PROTECTED]   fax (810) 958-5148
-
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of James Ho
Sent: Tuesday, August 29, 2000 12:18 PM
To: Orion-Interest
Subject: Re: EJB finder methods.


Hi Paul

I am a newbie in EJB...so don't know if this will really helps..

I guess u implement the finder methods in the bean class?  and also modify
the Home interface file to add that method in.

Regards, James


 Where do I specify my own finder methods in my entity bean.
 _
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

 Share information about yourself, create your own public profile at
 http://profiles.msn.com.









RE: EJB finder methods.

2000-08-29 Thread Mike Cannon-Brookes

Yes,

Unfortunately at the moment there is no way to port finders in
orion-ejb-jar.xml from server to server. You can include this file in the
.jar though and Orion will deploy it with your finders intact. (Other
servers will just ignore it as far as I know)

Mike


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of Jeremy Cowgar
 Sent: Tuesday, 29 August 2000 11:56
 To: Orion-Interest
 Subject: RE: EJB finder methods.


 In a finder method, how do you automatically have a custom SQL
 statement...For instance:

 CREATE TABLE names (
   nameID int,
   fname char(20),
   lname char(20),
   city char(40))

 Collection findByCity(String sCity);

 I would like to set an ORDER BY lname in my finder method...I
 know it can be
 done in the application deployment, but what about if I ship my
 EJB to other
 companies, do I have to have them edit all the application deployment .xml
 files to add custom finders?

 Thanks!

 Jeremy - [EMAIL PROTECTED]
 Christian Brotherhood Newsletter

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of Roman Kagan
 Sent: Tuesday, August 29, 2000 8:22 AM
 To: Orion-Interest
 Subject: RE: EJB finder methods.
 Importance: High


 First of all implement the Entity Bean with Container Managed Persistence.
 In that case you'll need to have finder method declared in Home interface
 and
 implemented in Primary Key class.  YOU WILL NOT HAVE finder METHOD IN EJB
 CLASS for CMP.  It will be written by the container at the
 deployment time!

 Check page 89 in "Enterprise Java Beans" 2nd edition by Richard
 Monson-Haefel


 -
 Roman Kagan   5155 Bantry Dr
 Chief Architect   W. Bloomfield, MI 48322
 SoftFinity Corp.  phone (248) 227-1220
 [EMAIL PROTECTED] fax (810) 958-5148
 -
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of James Ho
 Sent: Tuesday, August 29, 2000 12:18 PM
 To: Orion-Interest
 Subject: Re: EJB finder methods.


 Hi Paul

 I am a newbie in EJB...so don't know if this will really helps..

 I guess u implement the finder methods in the bean class?  and also modify
 the Home interface file to add that method in.

 Regards, James


  Where do I specify my own finder methods in my entity bean.
 
 _
  Get Your Private, Free E-mail from MSN Hotmail at
http://www.hotmail.com.

 Share information about yourself, create your own public profile at
 http://profiles.msn.com.