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, RemoteException;

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]

Reply via email to