While the JDO2 spec introduced being able to specify a 1-1 relation as having
the related object as embedded, it doesn't appear to handle how to persist
inherited embedded objects.
public class A {
@Embedded
B b;
}
public class B {...}
public class C extends B {...}
So we embed an object, that may be a B or may be a C. Obviously, thinking in
an RDBMS context, it would be desirable to have a discriminator column stored
for the "b" field so we can extract the right type when reading it. The only
problem is that <embedded> doesn't allow specification of such a thing
(obviously we could default to some column name, but would be nice to specify
it). I'd propose adding <discriminator> as a subelement of <embedded> so
column name etc can be defined (and something equivalent for annotations).
Comments?
--
Andy
DataNucleus (http://www.datanucleus.org)