thanks Alexander,
If I have to find only by the userID primarykey
or only by the listID primary key?.......................
what if I have 3 contructors in the UserListPK
like this...
public UserListPK(String userID)
{
this.userID = userID;
}
public UserListPK(String listID)
{
this.listID = listID;
}
public UserListPK(String userID,String listID)
{
this.userID = userID;
this.listID = listID;
}
.....
will it work????
and what shall I specify in the deployment descripter..
shall I specify both as primary...
tia
indi..
----- Original Message -----
From: "Alexander Klyubin" <[EMAIL PROTECTED]>
To: "jBoss" <[EMAIL PROTECTED]>
Sent: Thursday, January 18, 2001 1:00 PM
Subject: RE: [jBoss-User] how to have COMPOSITE PRIMARY KEYS in jboss CMP.
> Create a UserListPK and use it as your primary key. There are some caveats
> though, you'll have to implemet equals() and hashCode() methods correctly.
>
> public class UserListPK
> {
> public String userID;
> public String listID;
>
> ...
> }
>
>
> When it's done, you just declare:
> public UserList findByPrimaryKey(UserListPK id) throws
> FinderException, RemoteException;
>
> Alexander Klyubin
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Indika Fernando
> Sent: Thursday, January 18, 2001 08:32
> To: [EMAIL PROTECTED]
> Subject: [jBoss-User] how to have COMPOSITE PRIMARY KEYS in jboss CMP.
>
>
> Hey all,
> I am using jboss CMP beans and I have an entity bean called a UserList and
> in this I have two container managed fields called userID and listID ,these
> two are composite primary keys....
> My quection is how jboss will find this....
> in the UserListHome how should I include the methods ...
>
> will this work with jboss:
> public UserList findByPrimaryKey(String userID,String listID) throws
> FinderException, RemoteExceptio
n;
>
> indi...(expecting a quick reply).
>
>
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> List Help?: [EMAIL PROTECTED]
>
>
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> List Help?: [EMAIL PROTECTED]
>
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]