Currently when a query has JDOHelper.getObjectId it just considers the identity value and not the class. It should also have a mapping for the discriminator, or equivalent (when using union). In particular
1. when in the SELECT clause
2. when in the WHERE clause
Need to add use-cases that this is aimed at, since in some cases it would not apply.