Hi,
Aaron Mulder wrote:
>
> If I define a primary key class with just one field (a string),
> and then I go to write ejbFindByPrimaryKey for BMP, should the parameter
> be the primary key class or a String?
It should be the primary key class. There is really no difference to any
other user defined primary key class.
I've done this with String and int and have had no problems.
To make life a bit easier, I sometimes define an extra finder method
findById() that takes the primitive type as an argument.
> I realize this is a little silly, but I'm developing on jBoss for
> ultimate deployment on WebSphere 3.0, which doesn't seem to support
> primitive Primary Keys, and also doesn't support CMP unless you use
> VisualAge to deploy.
For portability I currently do not use primitive primary keys at all.
But I hope this will change...
> When I made the ejbFindByPrimaryKey take a String it
> worked, but when I make it take the primary key class, jBoss barfs, and
> the spec seems unclear on this point.
Strange, I've had no problems with this.
Are you sure you remembered to change the primary key everywhere
(home.findByPrimaryKey(), bean.ejbFindByPrimaryKey() return type,
ejb-jar.xml, etc.) ?
Best Regards,
Ole Husgaard.
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]