Re: Programmatic retrieval of a persistent class' discriminator


Andy
 
Edited

The discriminator is clearly in the retrieval SQL when you query for objects, but is only used to decide which type of class to instantiate.
It would be part of the metadata for the class, so you could use the JDO MetaData API to extract the discriminator value for a specific class

pmf.getMetadata(MyClass.class.getName()).getInheritanceMetadata().getDiscriminatorMetadata().getValue();

Join main@datanucleus.groups.io to automatically receive all group messages.