Got the solution.. thanks,...
IN the primary key class constructor i wan not using new String()..
I used it and it worked..
----- Original Message -----
From: Luis F. Canals <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 19, 2000 4:26 AM
Subject: Re: Primary Key String
Maybe you don't have any row in your table... I'm trying to reproduce your
situation and I have no errors, but I'll ask you the sorce code of the Bean
itself and the ejb-jar.xml file (simplified...) in order to obtain more
information about this error.
Are you sure you have commited the transaction (insert XXX; commit;) before
calling findByPrimaryKey? This is the only situation I've been able to
obtain this error.
Please, say us which EJB Server and DataBase are you using?
Thanks a lot. Regards.
Luis F. Canals Samaniego
CEDETEL
Parque Tecnol�gico de Boecillo
Edificio Centro, Parcela 109
E-47151 Boecillo (Valladolid)
SPAIN
Tfno: +34 983 54 65 02
Fax: +34 983 54 66 96
-----Mensaje original-----
De: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]En nombre de [EMAIL PROTECTED]
Enviado el: mi�rcoles 19 de julio de 2000 10:09
Para: [EMAIL PROTECTED]
Asunto: Re: Primary Key String
I can't say what's going wrong, but why do you use a PK class? If you're PK
is of type String you can use the String class directly.
> -----Original Message-----
> From: Pranjal [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 01, 1999 1:47 AM
> To: [EMAIL PROTECTED]
> Subject: Primary Key String
>
>
> I am building an entity bean with string parameter as primary key
> In primary key class i have String as attribute and also
> methods equals()
> and hascode()
>
> but when i try accessing from client.. error comes as :
> ********************************************************
> ObjectNotFoundException: primary key not found , with primary key xyz
> **********************************************************
> but the entry of that recoed is there in the table..?
>
> In table the primary key is of type char.
>
> can anybody suggest some thing..
> here is the client code
> *********************************
> UserInfoEntityHome userSesHome = (UserInfoEntityHome)
> ic.lookup("UserInfoEntity.user");
> System.out.println("home found************");
> com.powershare.userinfo.UserInfoPK pk = new
> com.powershare.userinfo.UserInfoPK();
> pk.userID = "xyz";
>
> UserInfoEntityRemote userDet = userSesHome.findByPrimaryKey(pk);
>
> ***********************************
>
> here is the primary key code
>
> ***************************************************************
>
> public class UserInfoPK implements java.io.Serializable
> {
> public String userID = null;
>
> public UserInfoPK() {}
>
> public UserInfoPK(String uid)
> {
> userID = new String(uid);
> }
>
>
>
> public int hashCode()
> {
> return userID.hashCode();
>
> }
>
> public String toString()
> {
> return userID.toString();
> }
>
> public boolean equals(Object obj)
> {
> if(obj instanceof UserInfoPK)
> {
> UserInfoPK pk = (UserInfoPK) obj;
> return userID.equals(pk.userID);
> }
> else
> {
> return false;
> }
> }
>
> } // close UserInfoPK
>
> ==============================================================
> =============
> 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".