Hi Jim,

> Yes, exactly so. I should have made it clear, sorry. The naming
> convention is XXXHome and XXX are the home and remote interfaces, and
> XXXBean is a value object that conforms to the JavaBean spec (required
> further on in the app).
> 
> The id field is constrained as a primary key - I was under the
> impression that this implied that nulls were not permitted. 

I assume you mean in the database: not neccessarily, a 'primary
key constraint' usually implies a 'unique constraint' on the
primary key columns, thus, with one column only in the PK, one
NULL PK row migth be allowed; with a 2 column PK 'NULL, NULL'
'x, NULL' and 'NULL, x' might be all interpreted different as
unique PK values, will depend on the DB used, Oracle i.e. accepts
NULL values in PKs.

But this seems not to be the problem at all ...

> So the problem seems to be that the remote interfaces in the collection
> returned by findAll seem to have lost their record of the id of the bean
> they represent.  Is this to do with my use of value objects? Is it
> necessary to have a simple getter for the primary key on the remote
> interface?

No, neither with CMP nor with BMP (which you told us to use);
though, with CMP you had to have a public PK field, which the
container accesses to read and write. But with BMP YOU are
responsible to load and store the bean instances state, whether
you use simple fields only in your bean or a value object or both.

In your original message you've given neither a stack trace nor
indications of your ejbLoad()/ejbStore()/ejbFindAll() methods,
you didn't show us the constructors of your value object. Is it
a true value object (no setters)?

Consider giving us more precise information, then it might be
someone sees the error and we haven't to guess most of your
problem.

regards

Georg
 ___   ___
| + | |__    Georg Rehfeld      Woltmanstr. 12     20097 Hamburg
|_|_\ |___   [EMAIL PROTECTED]           +49 (40) 23 53 27 10



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to