db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig Russell <Craig.Russ...@Sun.COM>
Subject VOTE: Change handling of null primary key during makePersistent of SingleFieldIdentity classes
Date Tue, 05 Jul 2005 20:43:35 GMT

A straightforward implementation of makePersistent will obtain the  
value of the identity object by delegating to jdoNewObjectIdInstance  
of the instance to be made persistent. This is the specified behavior:

A7.12-38 [For classes using single field identity, this method must  
be called on an instance of a persistence-capable class with its  
primary key field initialized (not null), or a  
JDOFatalInternalException is thrown.]

The simple enhanced method will delegate to, e.g. new IntIdentity  
passing the null field as the argument. This results in a  
NullPointerException that needs to be caught by the enhanced code.

Proposal: Change the behavior of the SingleFieldIdentity classes to  
throw JDONullIdentityFieldException. This allows a straightforward  
implementation of enhanced classes to support single field identity.

[ ] approve

[ ] disapprove. Why?



Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!

View raw message