DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: Minor Minor
Assignee: Unassigned
Reporter: Chris Colman
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

Incorrect warning "Really you need a discriminator" when a base class reference to an extended abstract class is null

Created: 17/Aug/09 10:51 AM   Updated: 26/Dec/09 12:56 PM   Resolved: 10/Dec/09 11:21 AM
Component/s: ORM
Affects Version/s: 1.1.5
Fix Version/s: None

File Attachments: 1. Zip Archive (7 kB)

Image Attachments:

1. reallyYouNeedADiscriminatorWarning.jpg
(58 kB)
Environment: Win XP, MySQL, Intel Core 2 Duo, 4GB RAM

Forum Thread URL:,5697_offset
Datastore: MySQL
Severity: Production

 Description  « Hide
WIth the following class diagram:

              ConcreteBase -------------
                           ^ |
                           | |
                  AbstractExt1 <---------------
                     ^ ^
                     / \
ConcreteExt1Ext1 ConcreteExt1Ext2

When loading the reference from ConcreteBase to AbstractExt1 AND that reference is null then an incorrect warning is produced:

     [java] 2009/08/17 19:25:20.111 WARN [DataNucleus.Persistence ] Found type=class org.datanucleus.test.ConcreteExt1Ext2 but abstract and more than 1 concrete subclass. Really you need a discriminator to help identifying the type. Choosing class org.datanucleus.test.ConcreteExt1Ext2

Various aspects of this warning are incorrect as evidenced by the metadata contained in the provided test case.

According to my reasoning there is nothing wrong with the class diagram nor its associated metadata and so the warning should not be produced for this scenario.

Sort Order: Ascending order - Click to sort in descending order
Chris Colman added a comment - 17/Aug/09 10:57 AM
Given the crippled ASCII class diagram I've attached an image to describe the class diagram that causes this warning.

Chris Colman added a comment - 17/Aug/09 11:02 AM
Test case

Chris Colman added a comment - 17/Aug/09 11:05 AM
I set the priority of this to Major in case there is something about this issue that affects the operation rather than just presenting a false warning. If the false warning is the only consequence of this issue then the priority should be reduced to minor.

Andy Jefferson added a comment - 17/Aug/09 11:29 AM
Issue is not the query but instead the loading of related fields, and in that query there is a discriminator but it has no value since there is no result. Consequently nothing is affected and it is a logged warning only meaning the user is not impacted in the slightest, and the majority of users don't know what a log is :-) Downgraded to minor

Andy Jefferson added a comment - 10/Dec/09 11:21 AM
I don't see anything of this form in current code.