Thanks Tom, it works now.
-----Original Message-----
From: Tom Cook [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 05, 2001 9:17 PM
To: JBoss-User
Subject: Re: [jBoss-User] What to put in xml
On Mon, 5 Mar 2001, Shen, Yi wrote:
> Hi,
> I am a first time user of jBoss.
> I have a question:
> If the Primary Key of my table contains more than one field, what should I
> put in the <primary-key filed></primary-key filed> in ejb-jar.xml?
> I got a exception complaining about :
> Error in ejb-jar.xml for Entity Bean MyEntityBean: expected only one
> primkey-field tag
You don't. You need to create a composite primary key class, and make
sure that the fields of it are public and have the same names as the
primary key fields of your EJB. Then make ejbCreate return this
type ( and ejbFindByPrimaryKey use this type etc. ). Then set
primkey-field to an empty value, and set 'prim-key-type' (or whatever it
is - check that) to your primary key type.
Tom
--
"If you mess with something for long enough it will break." - Schmidt
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]