Just don't specify primkey-field at all :)
Alexander Klyubin
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Indika Fernando
Sent: Tuesday, January 23, 2001 12:35
To: [EMAIL PROTECTED]
Subject: [jBoss-User] how should I have COMPOSITE Primary Keys in the
DEPLOYMENT DESCRIPTOR.
how should I have composite Primary Keys in the Deployment Descriptor......
The following is part of my D.Descriptor for UserListBean(entity) that I
tried but doesn't work with jboss......
<entity>
.......
.........
<primkey-field>userID,listID</primkey-field>
</entity>
AND
<entity>
.......
.........
<primkey-field>userID,listID</primkey-field>
<primkey-field>listID</primkey-field>
</entity>
My UserListPK class is the following
public class UserListPK implements java.io.Serializable
{
public String userID;
public String listID;
public UserListPK(String userID,String listID)
{
this.userID = userID;
this.listID = listID;
}
public UserListPK(){}
public String toString()
{
return userID;
}
}
My Home interface is this:
public interface UserListHome extends EJBHome
{
UserList create(String id) throws
CreateException,RemoteException;
/**
* Finds a UserList by its primary Key (userID)
*/
public UserList findByPrimaryKey(UserListPK key) throws
FinderException, RemoteException;
public Collection findByUserID(String userID) throws FinderException,
RemoteException;
public Collection findByListID(String listID) throws FinderException,
RemoteException;
public Collection findAll() throws RemoteException, FinderException;
}
thanx in advance...(need 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]