A specific question about the JDO specification and object-id classes

From: Scott Morman (smorman_at_neo.rr.com)
Date: 05/12/04


Date: 12 May 2004 07:06:25 -0700

Hi,

I am working on a JDO implementation based on the 1.0.1 specification
and I have a rather specific question that I am hopeing somebody can
answer (or perhaps some hints). We want to be able to create
application identity object-ids for every PersistenceCapable class in
our object model (we are writing the application as well). Currently
we only have a single concrete object-id per class hierarchy. What we
want to have is an object-id per PersistenceCapable class. This would
allow us to be able to determine exactly what PersistenceCapable
class a particular object-id represents.

The problem is that in section 18.3 of the JDO 1.0.1 specification it
states the following:

"If the object-id class attribute is defined in any concrete class,
then the objectid class itself must be concrete, and no subclass of
the class may include the objectid-class attribute."

This statement tells me that according to the specification that we
cannot have an objectid per PersistenceCapable class. Section 18.3
tells me the best that we can do is have an abstract objectid-class
for each of the abstract PersistenceCapable classes and a single
concrete objectid-class for the rest of PersistenceCapable classes for
a particular class hierarchy.

My question is, why does this limitation exist? What is the reasoning
for preventing every PersistenceCapable class from having its own
objectid-class that simply extends its parent's objectid-class.

Any help would be greatly appreciated.

Thanks,
Scott